ImageClassifier
ImageClassifier is a python package for creating Image classifiers with the help of CNNs.
Installation
Use the package manager pip to install ImageClassifier.
pip install image-classifier
Data format
First you need to create or download the images and save them in a folder in their corresponding label folders.
example folder structure:
data-->
apple-->
(images related to apple)
banana-->
(images realated to banana)
here "data" is the main folder, "apple" and "banana" are the label folders which have their corresponding images related to them.
[NOTE]: You can create as many label folders as you want but they should have their corresponding images.
Usage
To create a Image classifier :-
Creating the data and model.
from ImageClassifier import CreateDataAndModel
main = CreateDataAndModel(file_path="./data/", model_file_name_to_save="model.hdf5", init_lr=0.0001, epochs=100, batch_size=32)
# Here "./data/" is the data folder where we have the label folder- "apple" and "banana" (Remember to include a "/" after the folder like "./data/" ). Basically, you have to give the data folder path where you have the label folders, it can also be like "./seg_pred/seg_pred/".
main.create() # This will create the data and the model for you.
Running the image classifier to predict a single image.
from ImageClassifier import Run
r = Run(model_file_name="model.hdf5") # The model file in your current directory
img_to_predict = "./example_dir/example.jpg"
pred = r.run(img_to_predict)
print(pred)
Output
apple
Running the image classifier to predict multiple images.
import os
r = Run("model.hdf5")
file_path = "./seg_pred/seg_pred/"
for file in os.listdir(file_path):
pred = r.run(file_path + file)
print(pred)
Output
apple
banana
banana
apple
banana
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
See the source code here /image-classifier/ImageClassifier/
Data types
You can use any type of images for creating data like- jpeg, png etc. Even mixed!!!
License
Metadata
Release files for image-classifier 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| image-classifier-0.0.1.tar.gz | 3.5 kB | Without provenance | Details for image-classifier-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| image_classifier-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for image_classifier-0.0.1-py3-none-any.whl |
Total release size: 8.1 kB
Release files / image-classifier-0.0.1.tar.gz
| Download URL | image-classifier-0.0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96a325be3bf853bda2b92936ace821456452f49110512f08421177e95376c0ff
|
|
BLAKE2b-256 checksum How to use checksums |
0ec5f6de1b4f1b1ae6bf85d250a7386205ee40dbc018c6cb05b70c4ccd10b439
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9
|
Release files / image_classifier-0.0.1-py3-none-any.whl
| Download URL | image_classifier-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0afd2408d6280b9c20351cad3dd10ebb5aa5ee8ff6b848c0a3ccefd2f16791e9
|
|
BLAKE2b-256 checksum How to use checksums |
b77e9cee30610c8fc02140c2d26286c919fd39c913e2a109eb030d8de07db08b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.7.9
|
Security for image-classifier 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.