This project is a sandbox project! This projects will be used for experiments!
- This project can be run only linux environment.
- This project is recommended to run on virtual environment include docker.
- Command
pip install -r requirements.txtto install dependency.
-
Train:
python3 train.py option=<configuration file (optional)>- Used to obtain weights.
- The
optionargument for indivisual training options.
-
Predict:
python3 classify.py weights=path/to/checkpoint_path/checkpoint_name image=path/to/image(s/dir) epoch=[best|last|<an epoch number>](optional) output_format=[csv|stdout](optional) -
Plot graph:
python3 plot.py path=path/to/checkpoint_path/checkpoint_name- Used to plot graph of train result.
- The graphs will be saved onto
path/to/checkpoint_path/checkpoint_namewithplot.png.
-
Export:
python3 export.py path=path/to/checkpoint_path/checkpoint_name epoch=[best|last|<an epoch number>] image_size=<image_size>- Export weights to saved_model and TFLite
- The weights files will be saved onto
path/to/checkpoint_path/checkpoint_name/export.
-
Select specific GPU (example):
CUDA_VISIBLE_DEVICES=[cpu|<GPU numbers (example: 0,1,2,3)>] python3 train.py option=example.yaml- The default uses all GPUs.
- If you have multiple GPUs and want to select specific GPU, you have to use this command form or set the
CUDA_VISIBLE_DEVICESvariable.
cfg/settings.yaml(default settings)option.yaml(user global settings)- configuration file (copied from
option.yaml)
- Dataloader options
- Image crop options
- Image translate options
- Color adjustment options
- Quality adjustment options
- Other dataloader options
- Train options
- Checkpoint path
- Training options (optimizer, loss, etc.)
- Learning rate scheduler options
- Model option
-
ResNet Models
resnet/18.yamlresnet/54.yamlresnet/102.yamlresnet/150.yamlresnet2l/15.yamlresnet2l/54.yamlresnet2l/110.yaml
-
CSPResNet Models
cspresnet/18.yamlcspresnet/54.yamlcspresnet/102.yamlcspresnet/150.yamlcspresnet2c/18.yamlcspresnet2c/54.yamlcspresnet2c/102.yamlcspresnet2c/150.yamlcspresnet2l2c/15.yamlcspresnet2l2c/54.yamlcspresnet2l2c/110.yamlcspresnet2l3c/15.yamlcspresnet2l3c/54.yamlcspresnet2l3c/110.yaml
-
Other Models
vgg16.yamlgooglenet.yaml
-
Details
- The ResNet models are implemented of 3-layers ResNet blocks with bottleneck.
- The ResNet2L models are implemented of 2-layers ResNet blocks without bottleneck.
- The CSPResNet and CSPResNet2L3C models are implemented of 3-Conv layers to implementing CSPNet structure.
- The CSPResNet2C and CSPResNet2L2C models are implemented of 2-Conv layers to implementing CSPNet structure.
- CPU: AMD Ryzen 7900 @ 4.0GHz; 90W
- Memory: DDR5 64GB
- GPU: RTX 4060 Ti 16GB @ 2.5GHz; 130W x2
- OS: Ubuntu 24.04 (docker image: nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04)
- Python: CPython 3.12
- TensorFlow version: 2.20.0