initial push
This commit is contained in:
BIN
backend/project_50/50/__pycache__/exp.cpython-310.pyc
Normal file
BIN
backend/project_50/50/__pycache__/exp.cpython-310.pyc
Normal file
Binary file not shown.
1
backend/project_50/50/camera_inference.py
Normal file
1
backend/project_50/50/camera_inference.py
Normal file
@@ -0,0 +1 @@
|
||||
python tools/demo.py video -f /home/kitraining/coco_tool/backend/project_50/50/exp.py -c ./YOLOX_outputs/exp/best_ckpt.pth --path /home/kitraining/Videos/test_1.mkv --conf 0.25 --nms 0.45 --tsize 640 --save_result --device gpu
|
||||
57
backend/project_50/50/exp.py
Normal file
57
backend/project_50/50/exp.py
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding:utf-8 -*-
|
||||
# Copyright (c) Megvii, Inc. and its affiliates.
|
||||
|
||||
import os
|
||||
|
||||
from yolox.exp import Exp as MyExp
|
||||
|
||||
|
||||
class Exp(MyExp):
|
||||
def __init__(self):
|
||||
super(Exp, self).__init__()
|
||||
self.data_dir = "/home/kitraining/To_Annotate/"
|
||||
self.train_ann = "coco_project_50_train.json"
|
||||
self.val_ann = "coco_project_50_valid.json"
|
||||
self.test_ann = "coco_project_50_test.json"
|
||||
self.num_classes = 2
|
||||
self.pretrained_ckpt = r'/home/kitraining/Yolox/YOLOX-main/pretrained/YOLOX_s.pth'
|
||||
self.depth = 0.33
|
||||
self.width = 0.50
|
||||
self.exp_name = os.path.split(os.path.realpath(__file__))[1].split(".")[0]
|
||||
|
||||
# -------------- training config --------------------- #
|
||||
self.warmup_epochs = 15 # More warmup
|
||||
self.max_epoch = 250 # more epochs
|
||||
self.act = "silu" #Activation function
|
||||
|
||||
# Thresholds
|
||||
self.test_conf = 0.01 # Low to catch more the second class
|
||||
self.nmsthre = 0.7
|
||||
|
||||
# Data Augmentation intens to improve generalization
|
||||
self.enable_mixup = True
|
||||
self.mixup_prob = 0.9 # mixup
|
||||
self.mosaic_prob = 0.9 # mosaico
|
||||
self.degrees = 30.0 # Rotation
|
||||
self.translate = 0.4 # Translation
|
||||
self.scale = (0.2, 2.0) # Scaling
|
||||
self.shear = 10.0 # Shear
|
||||
self.flip_prob = 0.8
|
||||
self.hsv_prob = 1.0
|
||||
|
||||
# Learning rate
|
||||
self.basic_lr_per_img = 0.001 / 64.0 # Lower LR to avoid divergence
|
||||
self.scheduler = "yoloxwarmcos"
|
||||
|
||||
# Loss weights
|
||||
self.cls_loss_weight = 8.0 # More weight to the classification loss
|
||||
self.obj_loss_weight = 1.0
|
||||
self.reg_loss_weight = 0.5
|
||||
|
||||
# Input size bigger for better detection of small objects like babys
|
||||
self.input_size = (832, 832)
|
||||
self.test_size = (832, 832)
|
||||
|
||||
# Batch size
|
||||
self.batch_size = 5 # Reduce if you have memory issues
|
||||
26
backend/project_50/50/exp_infer.py
Normal file
26
backend/project_50/50/exp_infer.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding:utf-8 -*-
|
||||
# Copyright (c) Megvii, Inc. and its affiliates.
|
||||
|
||||
import os
|
||||
|
||||
from yolox.exp import Exp as MyExp
|
||||
|
||||
|
||||
class Exp(MyExp):
|
||||
def __init__(self):
|
||||
super(Exp, self).__init__()
|
||||
self.data_dir = "/home/kitraining/To_Annotate/"
|
||||
self.train_ann = "coco_project_50_train.json"
|
||||
self.val_ann = "coco_project_50_valid.json"
|
||||
self.test_ann = "coco_project_50_test.json"
|
||||
self.num_classes = 2
|
||||
self.pretrained_ckpt = r'/home/kitraining/Yolox/YOLOX-main/pretrained/YOLOX-s.pth'
|
||||
self.depth = 1
|
||||
self.width = 1
|
||||
self.input_size = (640, 640)
|
||||
self.mosaic_scale = (0.1, 2)
|
||||
self.random_size = (10, 20)
|
||||
self.test_size = (640, 640)
|
||||
self.exp_name = os.path.split(os.path.realpath(__file__))[1].split(".")[0]
|
||||
self.enable_mixup = False
|
||||
Reference in New Issue
Block a user