icTrainer is a python module which allows users to train image classifier easily
Basically, this module is for python3
Install
$ pip install ictrainer
Also you can install manually.
clone repo
$ git https://github.com/koji/icTrainer.git
$ cd icTrainer/ictrainer
$ python setup.py install
How to Use
In this gude, we will create a dog/cat image classifier.
1.Collect Images
https://icrawler.readthedocs.io/en/latest/
$ ictrainer --mode collect --keyword dog -n 250
$ ictrainer --mode collect --keyword cat -n 250
You'll have dogs & cats images under dataset folder.
2. Resize images
In this step, we will change all images size for training. The current input size must be 320 x 180(required).
This step may be mess up images you collected, so you need to check all images manually. In the furture, there will be a function that save your time.
$ ictrainer --mode resize --target dog
$ ictrainer --mode resize --target cat
For people want to use resize mode for other thing, you can use reize images with the following command.
The folder structure should be the same the above.
$ ictrainer --mode resize --target cat --image_width 480 --image_height 320
3.Create folders for classes
This step, we'll need to create folders and distribute images to train & validation folder.
3-1. create folders
Create a couple of folders under dataset.
This step will be automated in the future.
dataset
├── train
│ ├── cat
│ └── dog
└── val
├── cat
└── dog
3-2. distribute images
Move images we got via image collect mode. In this case, probably we have 250 images for each other.
We will put 225 images for train and 25 images for validation so that train/dog has 225 images and validation/dog has 25 images. The cats should be the same.
4.Train Images
There are some options we need to put. The most important one is --classes which will be labels. In this case, we have dog & cat, so we need to put them as classes.
--batch: batch size default 16
--epoch: epoch default 30
--mname: output model name
--lr: learning rate default 1e-3
momentum: mementum default 0.9
We will use default settings.
$ ictrainer --mode train --classes "cat" "dog" --mname "dogAndcat_"
code
This code will be pushed soon. (cleaning up now)
pre-train model
smart device
https://github.com/koji/icTrainer/blob/master/model/smartdevice_epoch30.h5
classes = ['echo', 'echoplus', 'echoshow', 'googlehome', 'googlehomemini', 'nest']
Metadata
Release files for ictrainer 0.2.7
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 |
|---|---|---|---|---|
| ictrainer-0.2.7.tar.gz | 7.7 kB | Without provenance | Details for ictrainer-0.2.7.tar.gz |
Release files / ictrainer-0.2.7.tar.gz
| Download URL | ictrainer-0.2.7.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be4c9c85589fcfd94284d070df47c99d1c88b9a037b57e9efe0be6defddfae2f
|
|
BLAKE2b-256 checksum How to use checksums |
52fd9f974b9aba509ba324dd69683d30bdccfdde5e300462fc5b93c1427d4341
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/3.6.5
|
Security for ictrainer 0.2.7
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.