A package to analyse a directory full of images
Project description
imdir
PyPI page
a simple python package to analyse a directory full of images
Installation
stable version from pypi
pip install imdir
or latest from master branch
pip install git+https://github.com/dhananjayraut/imdir
Dependencies
- matplotlib
- pillow
Usage / example
# give path to class
im_dir = image_dir(path="../input/train/",recursive=True, nthreads=4)
imdir.sc_plot(alpha=0.5) # plot height and width as scatter plot
imdir.width_plot() # plot width as histogram using matplotlib
imdir.height_plot() # plot height as histogram using matplotlib
Documentation
class image_dir(builtins.object)
image_dir(path, recursive=False, nthreads=-1)
image directory class
Methods of this class
__init__(self, path, recursive=False, nthreads=-1)
Args:
path (str): path for the directory
recursive (Boolean): whether to discover all sub directories
default False
nthreads (int): Number of threads used
-1 (default) means use all cpu cores
0 means do it in main thread (slow)
Returns:
a image_dir object
exten_plot(self, **kwds)
bar plot for the image extensions
Args:
**kwds: Additional keyword arguments to
matplotlib.pyplot 's bar function
height_plot(self, **kwds)
histogram plot for the image height.
Args:
**kwds: Additional keyword arguments to
matplotlib.pyplot 's hist function
sc_plot(self, **kwds)
Scatter plot for the image dimensions
Args:
**kwds: Additional keyword arguments to
matplotlib.pyplot 's scatter function
width_plot(self, **kwds)
histogram plot for the image width.
Args:
**kwds: Additional keyword arguments to
matplotlib.pyplot 's hist function
or see help for the image_dir class
help(imdir.image_dir)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
imdir-0.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
imdir-0.1-py3-none-any.whl
(3.7 kB
view hashes)