Graduation Research
Table of Contents
The easiest way to install automatic_train is by running:
git clone https://github.com/ultra-supara/automatic_train.git
After installing automatic_train , you need to do is to run the following command:
pip install -r requirements.txt
Please note that entered values are case-sensitive. Default values are provided as an example to help you figure out what should be entered.
On manual setup, you need to replace only values written in uppercase.
Name | Tips | Description |
---|---|---|
PROJECT_NAME | automatic_train | My project name |
GITHUB_USERNAME | ultra-supara | My GitHub username |
FULL_NAME | sada atsushi | My realname |
OPEN_SOURCE_LICENSE | MIT license | Full OSS license |
app.py | python3 app.py | url Home |
first_option_auto_train | simply option | url autotrain |
second_option_auto_train | more detailed opt | url manualtrain |
upload_place | ihpc | upload.php ihpc server |
launch Flask app
python3 app.py
then , you may see this url Home
The deep learning part can all be operated from the browser side! We are currently preparing a Docker environment in which it can run.
This is an example of training with autotrain , One-Key Training
(a mechanism that allows machine learning from a browser without the need to adjust parameters).
The training conditions are in train_onekey.py
# 学習パラメタの設定
if __name__ == "__main__":
imagesize = 32 #N*32(N=(1,20))
epochs = 1
batch_size = 2
evalu_param = 'map'
eager = False
train_gpu = [0,]
classes_path = 'model_data/voc_classes.txt'
anchors_path = 'model_data/yolo_anchors.txt'
anchors_mask = [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
model_path = ''
input_shape = [imagesize, imagesize]
mosaic = True
mosaic_prob = 0.5
mixup = True
mixup_prob = 0.5
special_aug_ratio = 0.7
#label_smoothing = 0
Init_Epoch = 0
UnFreeze_Epoch = epochs
Unfreeze_batch_size = batch_size
Freeze_Train = False
Init_lr = 1e-3
Min_lr = Init_lr * 0.01
optimizer_type = "adam"
momentum = 0.937
weight_decay = 0
lr_decay_type = 'cos'
focal_loss = False
focal_alpha = 0.25
focal_gamma = 2
save_period = 10
eval_flag = True
eval_period = 20
num_workers = 1
train_annotation_path = '2007_train.txt'
val_annotation_path = '2007_val.txt'
os.environ["CUDA_VISIBLE_DEVICES"] = ','.join(str(x) for x in train_gpu)
ngpus_per_node = len(train_gpu)
gpus = tf.config.experimental.list_physical_devices(device_type='GPU')
This is an example of the results (static/train.txt
) when the combination of yolov7_v5CSPdarknet is turned around training with an epochs count of 50.
logs/yolov7_v5CSPdarknet/best_epoch_weights.h5 model, anchors, and classes loaded.
Configurations: ** each part of the network **
----------------------------------------------------------------------
| keys | values|
----------------------------------------------------------------------
| neck | |
| backbone | |
| classes_path | model_data/voc_classes.txt|
| anchors_path | model_data/yolo_anchors.txt|
| anchors_mask | [[6, 7, 8], [3, 4, 5], [0, 1, 2]]|
| input_shape | []|
| confidence | 0.5|
| nms_iou | 0.3|
| max_boxes | 100|
| letterbox_image | True|
----------------------------------------------------------------------
Load model done.
Get predict result.
Get predict result done.
Get ground truth result.
Get ground truth result done.
Get map.
...
yolov7 + v5CSPdarknet done!
There are 6 backbones.
Current training model: yolov7 + xCSPdarknet!
Evaluation parameter: mAP
Total GFLOPs: 0.284G
Configurations: ** each parameters **
----------------------------------------------------------------------
| keys | values|
----------------------------------------------------------------------
| classes_path | model_data/voc_classes.txt|
| anchors_path | model_data/yolo_anchors.txt|
| anchors_mask | [[6, 7, 8], [3, 4, 5], [0, 1, 2]]|
| model_path | |
| input_shape | [32, 32]|
| Init_Epoch | 0|
| UnFreeze_Epoch | 50|
| Unfreeze_batch_size | 2|
| Freeze_Train | False|
| Init_lr | 0.001|
| Min_lr | 1e-05|
| optimizer_type | adam|
| momentum | 0.937|
| lr_decay_type | cos|
| save_period | 10|
| save_dir | logs/yolov7_xCSPdarknet|
| num_workers | 1|
| num_train | 409|
| num_val | 46|
----------------------------------------------------------------------
Train on 409 samples, val on 46 samples, with batch size 2.
----------------------------------------------------------------------
yolov7 + v5CSPdarknet done!
There are 6 backbones.
Current training model: yolov7 + xCSPdarknet!
This part shows the yolov7 + v5CSPdarknet combination has been trained, and the next part shows the yolov7 + xCSPdarknet being trained in succession. These can be done fully automatically. We have succeeded in automating the recombination process that was previously done manually by humans.
detection best model : static/evalu_parames.txt
yolov7_v5CSPdarknet,mAP:100.0%,flops:0.284323918G,model_size:204.553464MB,FPS:20.251316360863697,Parameters:50.902497M,
yolov7_xCSPdarknet,mAP:95.2%,flops:0.284323918G,model_size:204.579944MB,FPS:17.79088361770951,Parameters:50.902497M,
yolov7_v3darknet,mAP:92.4%,flops:0.385888334G,model_size:258.473392MB,FPS:17.01340010345215,Parameters:64.411713M,
yolov7_v7backbone,mAP:93.2%,flops:0.262721614G,model_size:150.126088MB,FPS:25.20116813428497,Parameters:37.346753M,
yolov7_v4CSPdarknet53,mAP:93.2%,flops:0.29979451G,model_size:202.75124MB,FPS:18.02773895714467,Parameters:50.443585M,
yolov5_v5CSPdarknet,mAP:87.2%,flops:0.232378318G,model_size:154.303304MB,FPS:24.313955865774663,Parameters:38.357737M,
yolov5_xCSPdarknet,mAP:85.4%,flops:0.232378318G,model_size:154.306808MB,FPS:29.451885644243497,Parameters:38.357737M,
yolov5_v3darknet,mAP:86.8%,flops:0.333942734G,model_size:208.223072MB,FPS:20.756551659258147,Parameters:51.866953M,
yolov5_v7backbone,mAP:86.3%,flops:0.211431374G,model_size:100.07604MB,FPS:45.17792878841556,Parameters:24.853193M,
yolov5_v4CSPdarknet53,mAP:88.0%,flops:0.24784891G,model_size:152.497128MB,FPS:28.897781129573318,Parameters:37.898825M,
yolov3_v5CSPdarknet,mAP:80.0%,flops:0.28694587G,model_size:193.377224MB,FPS:21.945551351170344,Parameters:48.169441M,
yolov3_xCSPdarknet,mAP:74.6%,flops:0.28694587G,model_size:193.385488MB,FPS:21.715122896668202,Parameters:48.169441M,
yolov3_v3darknet,mAP:77.4%,flops:0.388510286G,model_size:247.291248MB,FPS:17.55582086893424,Parameters:61.678657M,
yolov3_v7backbone,mAP:72.3%,flops:0.265343566G,model_size:138.944872MB,FPS:29.82171052299465,Parameters:34.613697M,
yolov3_v4CSPdarknet53,mAP:75.9%,flops:0.302416462G,model_size:191.576568MB,FPS:21.516757871989906,Parameters:47.710529M,
![image](https://github.com/ultra-supara/automatic_train/assets/67861004/c51593b0-47ae-4daa-b73d-173fe02e6a15)
In this video , first_option_auto_train automation_demonstraion
This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.
See LICENSE for more information.