This is an old revision of the document!
You can find the download and installation instructions here: Download and Installation
I suppose you downloaded the latest classification model.
This is the corresponding configuration file:
{ "model": { "input_size": [75,75] }, "train": { "batch_size": 32, "good_classes": "GOOD_CLASSES/", "bad_classes": "BAD_CLASSES/", "pretrained_weights": "", "saved_weights_name": "my_model.h5", "learning_rate": 1e-4, "nb_epoch": 100, "nb_early_stop": 5 } }
Copy this into a new file called config.json
.
To run the classification I suppose you want to seperate good and bad classes in classes_after_isac.hdf and you want to save your new .hdf files into the folder output_folder
. Furthermore you want to use the model model.h5
and the GPU with ID=1. Classes with a confidence bigger than 0.7 should be classified as good class.
This is the command to run:
sp_auto2d_predict.py -i path/to/classes_after_isac.hdf -w model.h5 -o output_folder/ -c config.json -t 0.7 --gpu 1
You will find the files classes_after_isac_good.hdf
and classes_after_isac_bad.hdf
in your output_folder
.
If you would like to train Auto2D with your own classes, you can easily do it.
First you have to separate your good and bad classes into separate files. Create two folders, on containing good classes (e.g GOOD_CLASSES/
) and one contain bad classes (e.g BAD_CLASSES/
). Both folders can contain multiple .hdf files.
Then specify the paths into a config file like this:
{ "model": { "input_size": [75,75] }, "train": { "batch_size": 32, "good_classes": "GOOD_CLASSES/", "bad_classes": "BAD_CLASSES/", "pretrained_weights": "", "saved_weights_name": "my_model.h5", "learning_rate": 1e-4, "nb_epoch": 100, "nb_early_stop": 5 } }
The next step is to run the training:
sp_auto2d_train.py -c example_config.json --gpu 1
This will train a classification network on the GPU with ID=1. After the training finishes, you get a my_model.h5
file. This can then be used to predict good / bad classes.