Skip to main content

PyPI version

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']   

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)

Source distribution for ictrainer 0.2.7
File Size Uploaded
ictrainer-0.2.7.tar.gz 7.7 kB Details

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

Release history Release notifications | RSS feed

This release

0.2.7 This release

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page