add multi trainings +fix path for coco retraining
This commit is contained in:
@@ -11,7 +11,7 @@ class Exp(MyExp):
|
||||
def __init__(self):
|
||||
super(Exp, self).__init__()
|
||||
self.data_dir = "/home/kitraining/To_Annotate" # Where images are located
|
||||
self.annotations_dir = "./backend/1/custom_exp_1" # Where annotation JSONs are located
|
||||
self.annotations_dir = "./backend\\1\\custom_exp_1" # Where annotation JSONs are located
|
||||
self.train_ann = "coco_project_1_train.json"
|
||||
self.val_ann = "coco_project_1_valid.json"
|
||||
self.test_ann = "coco_project_1_test.json"
|
||||
|
||||
@@ -2,291 +2,291 @@
|
||||
"images": [
|
||||
{
|
||||
"id": 794,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0028.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0028.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 193,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0030.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0030.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 693,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded6\\videorecorded6_0018.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded6\\videorecorded6_0018.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 826,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0060.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0060.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 178,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0025.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0025.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 340,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded4\\videorecorded4_0011.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded4\\videorecorded4_0011.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 109,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0053.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0053.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 279,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0023.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0023.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 613,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0043.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0043.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 448,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded4\\videorecorded4_0044.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded4\\videorecorded4_0044.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 589,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0035.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0035.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 222,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded3\\videorecorded3_0002.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded3\\videorecorded3_0002.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 256,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded3\\videorecorded3_0014.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded3\\videorecorded3_0014.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 577,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0031.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0031.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 859,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0033.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0033.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 436,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded4\\videorecorded4_0039.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded4\\videorecorded4_0039.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 868,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0042.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0042.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 775,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0009.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0009.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 852,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 876,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0050.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0050.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 796,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0030.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0030.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 582,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0032.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0032.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 547,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0021.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0021.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 163,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0020.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0020.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 417,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded4\\videorecorded4_0033.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded4\\videorecorded4_0033.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 521,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0013.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0013.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 829,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0003.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0003.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 854,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0028.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0028.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 848,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0022.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0022.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0015.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0015.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 889,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded9\\videorecorded9_0001.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded9\\videorecorded9_0001.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 562,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 831,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0005.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0005.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 845,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0019.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0019.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 723,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded6\\videorecorded6_0029.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded6\\videorecorded6_0029.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 348,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded4\\videorecorded4_0013.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded4\\videorecorded4_0013.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 218,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0001.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0001.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 75,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded1\\videorecorded1_0028.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded1\\videorecorded1_0028.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 288,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 716,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded6\\videorecorded6_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded6\\videorecorded6_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 126,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0007.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0007.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 488,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0005.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0005.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 395,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded4\\videorecorded4_0027.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded4\\videorecorded4_0027.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 405,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded4\\videorecorded4_0029.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded4\\videorecorded4_0029.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 394,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded4\\videorecorded4_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded4\\videorecorded4_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 202,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0033.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0033.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 646,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded6\\videorecorded6_0000.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded6\\videorecorded6_0000.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 531,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0016.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0016.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
}
|
||||
],
|
||||
"annotations": [
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,567 +2,567 @@
|
||||
"images": [
|
||||
{
|
||||
"id": 241,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0009.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0009.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 861,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0035.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0035.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 52,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded1\\videorecorded1_0020.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded1\\videorecorded1_0020.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 190,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0029.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0029.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 225,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded3\\videorecorded3_0003.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded3\\videorecorded3_0003.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 124,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0006.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0006.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 456,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded4\\videorecorded4_0048.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded4\\videorecorded4_0048.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 472,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0000.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0000.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 857,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0031.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0031.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 802,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0036.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0036.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 605,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0040.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0040.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 786,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0020.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0020.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 81,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0030.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0030.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 310,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0035.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0035.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 539,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0018.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0018.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 74,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0027.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0027.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 347,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded4\\videorecorded4_0013.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded4\\videorecorded4_0013.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 534,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0016.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0016.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 161,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded2\\videorecorded2_0020.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded2\\videorecorded2_0020.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 484,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0004.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0004.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 362,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded4\\videorecorded4_0018.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded4\\videorecorded4_0018.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 849,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0023.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0023.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 502,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0008.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0008.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 821,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0055.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0055.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 551,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0022.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0022.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 410,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded4\\videorecorded4_0031.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded4\\videorecorded4_0031.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 860,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0034.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0034.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 385,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded4\\videorecorded4_0024.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded4\\videorecorded4_0024.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 677,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded6\\videorecorded6_0012.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded6\\videorecorded6_0012.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 778,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0012.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0012.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 324,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded4\\videorecorded4_0005.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded4\\videorecorded4_0005.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 810,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded7\\videorecorded7_0044.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded7\\videorecorded7_0044.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 186,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded2\\videorecorded2_0028.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded2\\videorecorded2_0028.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 942,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded9\\videorecorded9_0054.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded9\\videorecorded9_0054.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded1\\videorecorded1_0020.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded1\\videorecorded1_0020.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 33,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0013.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0013.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 140,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded2\\videorecorded2_0013.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded2\\videorecorded2_0013.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 258,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded3\\videorecorded3_0015.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded3\\videorecorded3_0015.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 143,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded2\\videorecorded2_0014.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded2\\videorecorded2_0014.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0006.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0006.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 105,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0049.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0049.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 159,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded2\\videorecorded2_0019.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded2\\videorecorded2_0019.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 943,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded9\\videorecorded9_0055.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded9\\videorecorded9_0055.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 527,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0015.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0015.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 96,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0040.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0040.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 593,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0036.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0036.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 663,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded6\\videorecorded6_0008.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded6\\videorecorded6_0008.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 196,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0031.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0031.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 610,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0042.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0042.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 552,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0022.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0022.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 239,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded3\\videorecorded3_0008.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded3\\videorecorded3_0008.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 287,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded3\\videorecorded3_0025.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded3\\videorecorded3_0025.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 252,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0013.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0013.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 607,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0041.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0041.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 29,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded1\\videorecorded1_0012.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded1\\videorecorded1_0012.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 517,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0012.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0012.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 46,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded1\\videorecorded1_0018.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded1\\videorecorded1_0018.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 268,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded3\\videorecorded3_0019.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded3\\videorecorded3_0019.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 489,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0005.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0005.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 117,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0001.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0001.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 439,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded4\\videorecorded4_0040.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded4\\videorecorded4_0040.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 601,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0039.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0039.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 532,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0016.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0016.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 632,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0051.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0051.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 906,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded9\\videorecorded9_0018.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded9\\videorecorded9_0018.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 609,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0041.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0041.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 471,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded4\\videorecorded4_0060.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded4\\videorecorded4_0060.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 768,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded7\\videorecorded7_0004.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded7\\videorecorded7_0004.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 536,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0017.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0017.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 528,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0015.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0015.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 627,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0048.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0048.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 453,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded4\\videorecorded4_0047.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded4\\videorecorded4_0047.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 139,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded2\\videorecorded2_0012.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded2\\videorecorded2_0012.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 541,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0019.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0019.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 574,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0030.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0030.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 877,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0051.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0051.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 914,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded9\\videorecorded9_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded9\\videorecorded9_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 690,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded6\\videorecorded6_0017.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded6\\videorecorded6_0017.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 492,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0006.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0006.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 509,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0010.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0010.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 135,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded2\\videorecorded2_0011.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded2\\videorecorded2_0011.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 529,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded5\\videorecorded5_0015.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded5\\videorecorded5_0015.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 491,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded5\\videorecorded5_0005.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded5\\videorecorded5_0005.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 198,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded2\\videorecorded2_0032.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded2\\videorecorded2_0032.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 523,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded5\\videorecorded5_0014.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded5\\videorecorded5_0014.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 595,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded5\\videorecorded5_0037.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded5\\videorecorded5_0037.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 188,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded2\\videorecorded2_0029.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded2\\videorecorded2_0029.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 833,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded8\\videorecorded8_0007.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded8\\videorecorded8_0007.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 391,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_1\\videorecorded4\\videorecorded4_0026.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_1\\videorecorded4\\videorecorded4_0026.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 244,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded3\\videorecorded3_0010.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded3\\videorecorded3_0010.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 138,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_2\\videorecorded2\\videorecorded2_0012.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_2\\videorecorded2\\videorecorded2_0012.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded1\\videorecorded1_0002.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded1\\videorecorded1_0002.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 82,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_3\\videorecorded1\\videorecorded1_0031.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_3\\videorecorded1\\videorecorded1_0031.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
"file_name": "\\home\\kitraining\\To_Annotate/Baby\\RUN_4\\videorecorded1\\videorecorded1_0019.jpg",
|
||||
"width": 1280.0,
|
||||
"height": 720.0
|
||||
"file_name": "\\home\\kitraining\\To_Annotate\\Baby\\RUN_4\\videorecorded1\\videorecorded1_0019.jpg",
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
}
|
||||
],
|
||||
"annotations": [
|
||||
|
||||
85
backend/backend/1/custom_exp_2/exp.py
Normal file
85
backend/backend/1/custom_exp_2/exp.py
Normal file
@@ -0,0 +1,85 @@
|
||||
#!/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" # Where images are located
|
||||
self.annotations_dir = "./backend\\1\\custom_exp_2" # Where annotation JSONs are located
|
||||
self.train_ann = "coco_project_2_train.json"
|
||||
self.val_ann = "coco_project_2_valid.json"
|
||||
self.test_ann = "coco_project_2_test.json"
|
||||
self.num_classes = 2
|
||||
# Disable train2017 subdirectory - our images are directly in data_dir
|
||||
self.name = ""
|
||||
# Set data workers for training
|
||||
self.data_num_workers = 8
|
||||
self.pretrained_ckpt = r'/home/kitraining/Yolox/YOLOX-main/pretrained/YOLOX-s.pth'
|
||||
self.activation = "silu"
|
||||
self.depth = 0.33
|
||||
self.scheduler = "yoloxwarmcos"
|
||||
self.width = 0.5
|
||||
self.input_size = (640.0, 640.0)
|
||||
self.mosaic_scale = (0.1, 2.0)
|
||||
self.test_size = (640.0, 640.0)
|
||||
self.enable_mixup = True
|
||||
self.max_epoch = 300
|
||||
self.warmup_epochs = 5
|
||||
self.warmup_lr = 0.0
|
||||
self.no_aug_epochs = 15
|
||||
self.min_lr_ratio = 0.05
|
||||
self.ema = True
|
||||
self.weight_decay = 0.0005
|
||||
self.momentum = 0.9
|
||||
self.print_interval = 10
|
||||
self.eval_interval = 10
|
||||
self.test_conf = 0.01
|
||||
self.nms_thre = 0.65
|
||||
self.mosaic_prob = 1.0
|
||||
self.mixup_prob = 1.0
|
||||
self.hsv_prob = 1.0
|
||||
self.flip_prob = 0.5
|
||||
self.degrees = 10.0
|
||||
self.translate = 0.1
|
||||
self.shear = 2.0
|
||||
self.mixup_scale = (0.5, 1.5)
|
||||
self.random_size = (10, 20)
|
||||
|
||||
def get_dataset(self, cache=False, cache_type="ram"):
|
||||
"""Override to use name parameter for images directory"""
|
||||
from yolox.data import COCODataset
|
||||
|
||||
# COCODataset constructs image paths as: os.path.join(data_dir, name, file_name)
|
||||
# YOLOX adds "annotations/" to data_dir automatically, so we pass annotations_dir directly
|
||||
# Use empty string for name since we have absolute paths in JSON
|
||||
return COCODataset(
|
||||
data_dir=self.annotations_dir,
|
||||
json_file=self.train_ann,
|
||||
name="",
|
||||
img_size=self.input_size,
|
||||
preproc=self.preproc if hasattr(self, 'preproc') else None,
|
||||
cache=cache,
|
||||
cache_type=cache_type,
|
||||
)
|
||||
|
||||
def get_eval_dataset(self, **kwargs):
|
||||
"""Override eval dataset using name parameter"""
|
||||
from yolox.data import COCODataset
|
||||
|
||||
testdev = kwargs.get("testdev", False)
|
||||
legacy = kwargs.get("legacy", False)
|
||||
|
||||
return COCODataset(
|
||||
data_dir=self.annotations_dir,
|
||||
json_file=self.val_ann if not testdev else self.test_ann,
|
||||
name="",
|
||||
img_size=self.test_size,
|
||||
preproc=None, # No preprocessing for evaluation
|
||||
)
|
||||
self.exp_name = os.path.split(os.path.realpath(__file__))[1].split(".")[0]
|
||||
@@ -1,10 +0,0 @@
|
||||
// database.js
|
||||
const { Sequelize } = require('sequelize');
|
||||
|
||||
const sequelize = new Sequelize('myapp', 'root', 'root', {
|
||||
host: 'localhost',
|
||||
dialect: 'mysql',
|
||||
logging: false,
|
||||
});
|
||||
|
||||
module.exports = sequelize;
|
||||
@@ -1,12 +0,0 @@
|
||||
-- Migration: Add width and height columns to image table
|
||||
-- Date: 2025-11-27
|
||||
|
||||
USE myapp;
|
||||
|
||||
-- Add width and height columns to image table
|
||||
ALTER TABLE `image`
|
||||
ADD COLUMN `width` FLOAT NULL AFTER `image_path`,
|
||||
ADD COLUMN `height` FLOAT NULL AFTER `width`;
|
||||
|
||||
-- Verify the changes
|
||||
DESCRIBE `image`;
|
||||
@@ -1,12 +0,0 @@
|
||||
-- Migration to change width and height from FLOAT to INT in image table
|
||||
-- Run this after updating the Images model
|
||||
|
||||
-- First, backup the table (optional but recommended)
|
||||
-- CREATE TABLE image_backup AS SELECT * FROM image;
|
||||
|
||||
-- Alter the columns to INT type
|
||||
ALTER TABLE image MODIFY COLUMN width INT;
|
||||
ALTER TABLE image MODIFY COLUMN height INT;
|
||||
|
||||
-- Verify the changes
|
||||
DESCRIBE image;
|
||||
File diff suppressed because one or more lines are too long
@@ -1,40 +0,0 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
|
||||
const Annotation = sequelize.define('Annotation', {
|
||||
annotation_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
image_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
x: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
y: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
height: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
Label: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
tableName: 'annotation',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Annotation;
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Image = sequelize.define('Image', {
|
||||
image_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
image_path: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: true,
|
||||
},
|
||||
height: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: true,
|
||||
},
|
||||
|
||||
}, {
|
||||
tableName: 'image',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Image;
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Label_studio_project = sequelize.define('LabelStudioProject', {
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
},
|
||||
title:{
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
}
|
||||
|
||||
}, {
|
||||
tableName: 'label_studio_project',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Label_studio_project;
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Training_Project = sequelize.define('LabelStudioProject', {
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
},
|
||||
title:{
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
classes: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: false,
|
||||
},
|
||||
project_image: {
|
||||
type: DataTypes.BLOB,
|
||||
},
|
||||
project_image_type: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
}
|
||||
|
||||
}, {
|
||||
tableName: 'training_project',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Training_Project;
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const TrainingProjectDetails = sequelize.define('TrainingProjectDetails', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
unique: true,
|
||||
},
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
},
|
||||
annotation_projects: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: false,
|
||||
},
|
||||
class_map: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: true,
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: true,
|
||||
}
|
||||
}, {
|
||||
tableName: 'training_project_details',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = TrainingProjectDetails;
|
||||
@@ -1,30 +0,0 @@
|
||||
const LabelStudioProject = require('./LabelStudioProject.js');
|
||||
const Annotation = require('./Annotation.js');
|
||||
const Image = require('./Images.js');
|
||||
const sequelize = require('../database/database.js');
|
||||
const TrainingProjectDetails = require('./TrainingProjectDetails.js');
|
||||
const TrainingProject = require('./TrainingProject.js');
|
||||
const Training = require('./training.js');
|
||||
|
||||
|
||||
|
||||
const Project = LabelStudioProject;
|
||||
const Img = Image;
|
||||
const Ann = Annotation;
|
||||
|
||||
// Associations
|
||||
Project.hasMany(Img, { foreignKey: 'project_id' });
|
||||
Img.belongsTo(Project, { foreignKey: 'project_id' });
|
||||
|
||||
Img.hasMany(Ann, { foreignKey: 'image_id' });
|
||||
Ann.belongsTo(Img, { foreignKey: 'image_id' });
|
||||
|
||||
// TrainingProjectDetails <-> TrainingProject
|
||||
TrainingProjectDetails.belongsTo(TrainingProject, { foreignKey: 'project_id' });
|
||||
TrainingProject.hasOne(TrainingProjectDetails, { foreignKey: 'project_id' });
|
||||
|
||||
// Training <-> TrainingProjectDetails
|
||||
Training.belongsTo(TrainingProjectDetails, { foreignKey: 'project_details_id' });
|
||||
TrainingProjectDetails.hasMany(Training, { foreignKey: 'project_details_id' });
|
||||
|
||||
module.exports = { Project, Img, Ann, TrainingProjectDetails, TrainingProject, Training };
|
||||
@@ -1,140 +0,0 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Training = sequelize.define('training', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
autoIncrement: true,
|
||||
unique: true,
|
||||
primaryKey: true
|
||||
},
|
||||
exp_name: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
max_epoch: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
depth: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
activation: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
warmup_epochs: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
warmup_lr: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
basic_lr_per_img: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
scheduler: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
no_aug_epochs: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
min_lr_ratio: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
ema: {
|
||||
type: DataTypes.BOOLEAN
|
||||
},
|
||||
weight_decay: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
momentum: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
input_size: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
print_interval: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
eval_interval: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
save_history_ckpt: {
|
||||
type: DataTypes.BOOLEAN
|
||||
},
|
||||
test_size: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
test_conf: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
nms_thre: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
multiscale_range: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
enable_mixup: {
|
||||
type: DataTypes.BOOLEAN
|
||||
},
|
||||
mosaic_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
mixup_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
hsv_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
flip_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
degrees: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
mosaic_scale: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
mixup_scale: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
translate: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
shear: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
training_name: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
project_details_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
seed: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
train: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
valid: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
test: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
selected_model: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
transfer_learning: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
model_upload: {
|
||||
type: DataTypes.BLOB
|
||||
}
|
||||
}, {
|
||||
tableName: 'training',
|
||||
timestamps: false
|
||||
});
|
||||
|
||||
module.exports = Training;
|
||||
@@ -1,496 +0,0 @@
|
||||
const express = require('express');
|
||||
const multer = require('multer');
|
||||
const upload = multer();
|
||||
const TrainingProject = require('../models/TrainingProject.js');
|
||||
const LabelStudioProject = require('../models/LabelStudioProject.js')
|
||||
const { seedLabelStudio, updateStatus } = require('../services/seed-label-studio.js');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {generateTrainingJson} = require('../services/generate-json-yolox.js')
|
||||
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// Ensure JSON bodies are parsed for all routes
|
||||
router.use(express.json());
|
||||
|
||||
router.get('/seed', async (req, res) => {
|
||||
const result = await seedLabelStudio();
|
||||
res.json(result);
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Trigger generate-json-yolox.js
|
||||
|
||||
router.post('/generate-yolox-json', async (req, res) => {
|
||||
const { project_id } = req.body;
|
||||
if (!project_id) {
|
||||
return res.status(400).json({ message: 'Missing project_id in request body' });
|
||||
}
|
||||
try {
|
||||
// Generate COCO JSONs
|
||||
// Find all TrainingProjectDetails for this project
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const detailsRows = await TrainingProjectDetails.findAll({ where: { project_id } });
|
||||
if (!detailsRows || detailsRows.length === 0) {
|
||||
return res.status(404).json({ message: 'No TrainingProjectDetails found for project ' + project_id });
|
||||
}
|
||||
// For each details row, generate coco.jsons and exp.py in projectfolder/project_details_id
|
||||
const Training = require('../models/training.js');
|
||||
const { saveYoloxExp } = require('../services/generate-yolox-exp.js');
|
||||
const TrainingProject = require('../models/TrainingProject.js');
|
||||
const trainingProject = await TrainingProject.findByPk(project_id);
|
||||
const projectName = trainingProject.name ? trainingProject.name.replace(/\s+/g, '_') : `project_${project_id}`;
|
||||
for (const details of detailsRows) {
|
||||
const detailsId = details.id;
|
||||
await generateTrainingJson(detailsId);
|
||||
const trainings = await Training.findAll({ where: { project_details_id: detailsId } });
|
||||
if (trainings.length === 0) continue;
|
||||
// For each training, save exp.py in projectfolder/project_details_id
|
||||
const outDir = path.join(__dirname, '..', projectName, String(detailsId));
|
||||
if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
|
||||
for (const training of trainings) {
|
||||
const expFilePath = path.join(outDir, 'exp.py');
|
||||
await saveYoloxExp(training.id, expFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
// Find all trainings for this project
|
||||
// ...existing code...
|
||||
res.json({ message: 'YOLOX JSON and exp.py generated for project ' + project_id });
|
||||
} catch (err) {
|
||||
console.error('Error generating YOLOX JSON:', err);
|
||||
res.status(500).json({ message: 'Failed to generate YOLOX JSON', error: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
// Start YOLOX training
|
||||
const { spawn } = require('child_process');
|
||||
router.post('/start-yolox-training', async (req, res) => {
|
||||
try {
|
||||
const { project_id, training_id } = req.body;
|
||||
// Get project name
|
||||
const trainingProject = await TrainingProject.findByPk(project_id);
|
||||
const projectName = trainingProject.name ? trainingProject.name.replace(/\s+/g, '_') : `project_${project_id}`;
|
||||
// Look up training row by id or project_details_id
|
||||
const Training = require('../models/training.js');
|
||||
let trainingRow = await Training.findByPk(training_id);
|
||||
if (!trainingRow) {
|
||||
trainingRow = await Training.findOne({ where: { project_details_id: training_id } });
|
||||
}
|
||||
if (!trainingRow) {
|
||||
return res.status(404).json({ error: `Training row not found for id or project_details_id ${training_id}` });
|
||||
}
|
||||
const project_details_id = trainingRow.project_details_id;
|
||||
// Use the generated exp.py from the correct project folder
|
||||
const outDir = path.join(__dirname, '..', projectName, String(project_details_id));
|
||||
const yoloxMainDir = '/home/kitraining/Yolox/YOLOX-main';
|
||||
const expSrc = path.join(outDir, 'exp.py');
|
||||
if (!fs.existsSync(expSrc)) {
|
||||
return res.status(500).json({ error: `exp.py not found at ${expSrc}` });
|
||||
}
|
||||
// Source venv and run YOLOX training in YOLOX-main folder
|
||||
const yoloxVenv = '/home/kitraining/Yolox/yolox_venv/bin/activate';
|
||||
// Determine model argument based on selected_model and transfer_learning
|
||||
let modelArg = '';
|
||||
let cmd = '';
|
||||
if (
|
||||
trainingRow.transfer_learning &&
|
||||
typeof trainingRow.transfer_learning === 'string' &&
|
||||
trainingRow.transfer_learning.toLowerCase() === 'coco'
|
||||
) {
|
||||
// If transfer_learning is 'coco', add -o and modelArg
|
||||
modelArg = ` -c /home/kitraining/Yolox/YOLOX-main/pretrained/${trainingRow.selected_model}`;
|
||||
cmd = `bash -c 'source ${yoloxVenv} && python tools/train.py -f ${expSrc} -d 1 -b 8 --fp16 -o ${modelArg}.pth --cache'`;
|
||||
} else if (
|
||||
trainingRow.selected_model &&
|
||||
trainingRow.selected_model.toLowerCase() === 'coco' &&
|
||||
(!trainingRow.transfer_learning || trainingRow.transfer_learning === false)
|
||||
) {
|
||||
// If selected_model is 'coco' and not transfer_learning, add modelArg only
|
||||
modelArg = ` -c /pretrained/${trainingRow.selected_model}`;
|
||||
cmd = `bash -c 'source ${yoloxVenv} && python tools/train.py -f ${expSrc} -d 1 -b 8 --fp16 -o ${modelArg}.pth --cache'`;
|
||||
} else {
|
||||
// Default: no modelArg
|
||||
cmd = `bash -c 'source ${yoloxVenv} && python tools/train.py -f ${expSrc} -d 1 -b 8 --fp16' --cache`;
|
||||
}
|
||||
console.log(cmd)
|
||||
const child = spawn(cmd, { shell: true, cwd: yoloxMainDir });
|
||||
child.stdout.pipe(process.stdout);
|
||||
child.stderr.pipe(process.stderr);
|
||||
|
||||
res.json({ message: 'Training started' });
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: 'Failed to start training', details: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
// Get YOLOX training log
|
||||
router.get('/training-log', async (req, res) => {
|
||||
try {
|
||||
const { project_id, training_id } = req.query;
|
||||
const trainingProject = await TrainingProject.findByPk(project_id);
|
||||
const projectName = trainingProject.name ? trainingProject.name.replace(/\s+/g, '_') : `project_${project_id}`;
|
||||
const outDir = path.join(__dirname, '..', projectName, String(training_id));
|
||||
const logPath = path.join(outDir, 'training.log');
|
||||
if (!fs.existsSync(logPath)) {
|
||||
return res.status(404).json({ error: 'Log not found' });
|
||||
}
|
||||
const logData = fs.readFileSync(logPath, 'utf8');
|
||||
res.json({ log: logData });
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: 'Failed to fetch log', details: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/training-projects', upload.single('project_image'), async (req, res) => {
|
||||
try {
|
||||
const { title, description } = req.body;
|
||||
const classes = JSON.parse(req.body.classes);
|
||||
const project_image = req.file ? req.file.buffer : null;
|
||||
const project_image_type = req.file ? req.file.mimetype : null;
|
||||
await TrainingProject.create({
|
||||
title,
|
||||
description,
|
||||
classes,
|
||||
project_image,
|
||||
project_image_type
|
||||
});
|
||||
res.json({ message: 'Project created!' });
|
||||
} catch (error) {
|
||||
console.error('Error creating project:', error);
|
||||
res.status(500).json({ message: 'Failed to create project', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/training-projects', async (req, res) => {
|
||||
try {
|
||||
const projects = await TrainingProject.findAll();
|
||||
// Convert BLOB to base64 data URL for each project
|
||||
const serialized = projects.map(project => {
|
||||
const plain = project.get({ plain: true });
|
||||
if (plain.project_image) {
|
||||
const base64 = Buffer.from(plain.project_image).toString('base64');
|
||||
const mimeType = plain.project_image_type || 'image/png';
|
||||
plain.project_image = `data:${mimeType};base64,${base64}`;
|
||||
}
|
||||
return plain;
|
||||
});
|
||||
res.json(serialized);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to fetch projects', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/update-status', async (req, res) => {
|
||||
res.json(updateStatus)
|
||||
})
|
||||
|
||||
router.get('/label-studio-projects', async (req, res) => {
|
||||
try {
|
||||
const LabelStudioProject = require('../models/LabelStudioProject.js');
|
||||
const Image = require('../models/Images.js');
|
||||
const Annotation = require('../models/Annotation.js');
|
||||
const labelStudioProjects = await LabelStudioProject.findAll();
|
||||
const projectsWithCounts = await Promise.all(labelStudioProjects.map(async project => {
|
||||
const plain = project.get({ plain: true });
|
||||
// Get all images for this project
|
||||
const images = await Image.findAll({ where: { project_id: plain.project_id } });
|
||||
let annotationCounts = {};
|
||||
if (images.length > 0) {
|
||||
const imageIds = images.map(img => img.image_id);
|
||||
// Get all annotations for these images
|
||||
const annotations = await Annotation.findAll({ where: { image_id: imageIds } });
|
||||
// Count by label
|
||||
for (const ann of annotations) {
|
||||
const label = ann.Label;
|
||||
annotationCounts[label] = (annotationCounts[label] || 0) + 1;
|
||||
}
|
||||
}
|
||||
plain.annotationCounts = annotationCounts;
|
||||
return plain;
|
||||
}));
|
||||
res.json(projectsWithCounts);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to fetch projects', error: error.message });
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// POST endpoint to create TrainingProjectDetails with all fields
|
||||
router.post('/training-project-details', async (req, res) => {
|
||||
try {
|
||||
const {
|
||||
project_id,
|
||||
annotation_projects,
|
||||
class_map,
|
||||
description
|
||||
} = req.body;
|
||||
if (!project_id || !annotation_projects) {
|
||||
return res.status(400).json({ message: 'Missing required fields' });
|
||||
}
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const created = await TrainingProjectDetails.create({
|
||||
project_id,
|
||||
annotation_projects,
|
||||
class_map: class_map || null,
|
||||
description: description || null
|
||||
});
|
||||
res.json({ message: 'TrainingProjectDetails created', details: created });
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to create TrainingProjectDetails', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// GET endpoint to fetch all TrainingProjectDetails
|
||||
router.get('/training-project-details', async (req, res) => {
|
||||
try {
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const details = await TrainingProjectDetails.findAll();
|
||||
res.json(details);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to fetch TrainingProjectDetails', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// PUT endpoint to update class_map and description in TrainingProjectDetails
|
||||
router.put('/training-project-details', async (req, res) => {
|
||||
try {
|
||||
const { project_id, class_map, description } = req.body;
|
||||
if (!project_id || !class_map || !description) {
|
||||
return res.status(400).json({ message: 'Missing required fields' });
|
||||
}
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const details = await TrainingProjectDetails.findOne({ where: { project_id } });
|
||||
if (!details) {
|
||||
return res.status(404).json({ message: 'TrainingProjectDetails not found' });
|
||||
}
|
||||
details.class_map = class_map;
|
||||
details.description = description;
|
||||
await details.save();
|
||||
res.json({ message: 'Class map and description updated', details });
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to update class map or description', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// POST endpoint to receive YOLOX settings and save to DB (handles multipart/form-data)
|
||||
router.post('/yolox-settings', upload.any(), async (req, res) => {
|
||||
try {
|
||||
const settings = req.body;
|
||||
// Debug: Log all received fields and types
|
||||
console.log('--- YOLOX settings received ---');
|
||||
console.log('settings:', settings);
|
||||
if (req.files && req.files.length > 0) {
|
||||
console.log('Files received:', req.files.map(f => ({ fieldname: f.fieldname, originalname: f.originalname, size: f.size })));
|
||||
}
|
||||
// Declare requiredFields once
|
||||
const requiredFields = ['project_details_id', 'exp_name', 'max_epoch', 'depth', 'width', 'activation', 'train', 'valid', 'test', 'selected_model', 'transfer_learning'];
|
||||
// Log types of required fields
|
||||
requiredFields.forEach(field => {
|
||||
console.log(`Field '${field}': value='${settings[field]}', type='${typeof settings[field]}'`);
|
||||
});
|
||||
// Map select_model to selected_model if present
|
||||
if (settings && settings.select_model && !settings.selected_model) {
|
||||
settings.selected_model = settings.select_model;
|
||||
delete settings.select_model;
|
||||
}
|
||||
// Lookup project_details_id from project_id
|
||||
if (!settings.project_id || isNaN(Number(settings.project_id))) {
|
||||
throw new Error('Missing or invalid project_id in request. Cannot assign training to a project.');
|
||||
}
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
let details = await TrainingProjectDetails.findOne({ where: { project_id: settings.project_id } });
|
||||
if (!details) {
|
||||
details = await TrainingProjectDetails.create({
|
||||
project_id: settings.project_id,
|
||||
annotation_projects: [],
|
||||
class_map: null,
|
||||
description: null
|
||||
});
|
||||
}
|
||||
settings.project_details_id = details.id;
|
||||
// Map 'act' from frontend to 'activation' for DB
|
||||
if (settings.act !== undefined) {
|
||||
settings.activation = settings.act;
|
||||
delete settings.act;
|
||||
}
|
||||
// Type conversion for DB compatibility
|
||||
[
|
||||
'max_epoch', 'depth', 'width', 'warmup_epochs', 'warmup_lr', 'no_aug_epochs', 'min_lr_ratio', 'weight_decay', 'momentum', 'print_interval', 'eval_interval', 'test_conf', 'nmsthre', 'multiscale_range', 'degrees', 'translate', 'shear', 'train', 'valid', 'test'
|
||||
].forEach(f => {
|
||||
if (settings[f] !== undefined) settings[f] = Number(settings[f]);
|
||||
});
|
||||
// Improved boolean conversion
|
||||
['ema', 'enable_mixup', 'save_history_ckpt'].forEach(f => {
|
||||
if (settings[f] !== undefined) {
|
||||
if (typeof settings[f] === 'string') {
|
||||
settings[f] = settings[f].toLowerCase() === 'true';
|
||||
} else {
|
||||
settings[f] = Boolean(settings[f]);
|
||||
}
|
||||
}
|
||||
});
|
||||
// Improved array conversion
|
||||
['mosaic_scale', 'mixup_scale', 'scale'].forEach(f => {
|
||||
if (settings[f] && typeof settings[f] === 'string') {
|
||||
settings[f] = settings[f]
|
||||
.split(',')
|
||||
.map(s => Number(s.trim()))
|
||||
.filter(n => !isNaN(n));
|
||||
}
|
||||
});
|
||||
// Trim all string fields
|
||||
Object.keys(settings).forEach(f => {
|
||||
if (typeof settings[f] === 'string') settings[f] = settings[f].trim();
|
||||
});
|
||||
// Set default for transfer_learning if missing
|
||||
if (settings.transfer_learning === undefined) settings.transfer_learning = false;
|
||||
// Convert empty string seed to null
|
||||
if ('seed' in settings && (settings.seed === '' || settings.seed === undefined)) {
|
||||
settings.seed = null;
|
||||
}
|
||||
// Validate required fields for training table
|
||||
for (const field of requiredFields) {
|
||||
if (settings[field] === undefined || settings[field] === null || settings[field] === '') {
|
||||
console.error('Missing required field:', field, 'Value:', settings[field]);
|
||||
throw new Error('Missing required field: ' + field);
|
||||
}
|
||||
}
|
||||
console.log('Received YOLOX settings:', settings);
|
||||
// Handle uploaded model file (ckpt_upload)
|
||||
if (req.files && req.files.length > 0) {
|
||||
const ckptFile = req.files.find(f => f.fieldname === 'ckpt_upload');
|
||||
if (ckptFile) {
|
||||
const uploadDir = path.join(__dirname, '..', 'uploads');
|
||||
if (!fs.existsSync(uploadDir)) fs.mkdirSync(uploadDir);
|
||||
const filename = ckptFile.originalname || `uploaded_model_${settings.project_id}.pth`;
|
||||
const filePath = path.join(uploadDir, filename);
|
||||
fs.writeFileSync(filePath, ckptFile.buffer);
|
||||
settings.model_upload = filePath;
|
||||
}
|
||||
}
|
||||
// Save settings to DB only (no file)
|
||||
const { pushYoloxExpToDb } = require('../services/push-yolox-exp.js');
|
||||
const training = await pushYoloxExpToDb(settings);
|
||||
res.json({ message: 'YOLOX settings saved to DB', training });
|
||||
} catch (error) {
|
||||
console.error('Error in /api/yolox-settings:', error.stack || error);
|
||||
res.status(500).json({ message: 'Failed to save YOLOX settings', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// POST endpoint to receive binary model file and save to disk (not DB)
|
||||
router.post('/yolox-settings/upload', async (req, res) => {
|
||||
try {
|
||||
const projectId = req.query.project_id;
|
||||
if (!projectId) return res.status(400).json({ message: 'Missing project_id in query' });
|
||||
// Save file to disk
|
||||
const uploadDir = path.join(__dirname, '..', 'uploads');
|
||||
if (!fs.existsSync(uploadDir)) fs.mkdirSync(uploadDir);
|
||||
const filename = req.headers['x-upload-filename'] || `uploaded_model_${projectId}.pth`;
|
||||
const filePath = path.join(uploadDir, filename);
|
||||
const chunks = [];
|
||||
req.on('data', chunk => chunks.push(chunk));
|
||||
req.on('end', async () => {
|
||||
const buffer = Buffer.concat(chunks);
|
||||
fs.writeFile(filePath, buffer, async err => {
|
||||
if (err) {
|
||||
console.error('Error saving file:', err);
|
||||
return res.status(500).json({ message: 'Failed to save model file', error: err.message });
|
||||
}
|
||||
// Update latest training row for this project with file path
|
||||
try {
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const Training = require('../models/training.js');
|
||||
// Find details row for this project
|
||||
const details = await TrainingProjectDetails.findOne({ where: { project_id: projectId } });
|
||||
if (!details) return res.status(404).json({ message: 'No TrainingProjectDetails found for project_id' });
|
||||
// Find latest training for this details row
|
||||
const training = await Training.findOne({ where: { project_details_id: details.id }, order: [['createdAt', 'DESC']] });
|
||||
if (!training) return res.status(404).json({ message: 'No training found for project_id' });
|
||||
// Save file path to model_upload field
|
||||
training.model_upload = filePath;
|
||||
await training.save();
|
||||
res.json({ message: 'Model file uploaded and saved to disk', filename, trainingId: training.id });
|
||||
} catch (dbErr) {
|
||||
console.error('Error updating training with file path:', dbErr);
|
||||
res.status(500).json({ message: 'File saved but failed to update training row', error: dbErr.message });
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error in /api/yolox-settings/upload:', error.stack || error);
|
||||
res.status(500).json({ message: 'Failed to upload model file', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// GET endpoint to fetch all trainings (optionally filtered by project_id)
|
||||
router.get('/trainings', async (req, res) => {
|
||||
try {
|
||||
const project_id = req.query.project_id;
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const Training = require('../models/training.js');
|
||||
if (project_id) {
|
||||
// Find all details rows for this project
|
||||
const detailsRows = await TrainingProjectDetails.findAll({ where: { project_id } });
|
||||
if (!detailsRows || detailsRows.length === 0) return res.json([]);
|
||||
// Get all trainings linked to any details row for this project
|
||||
const detailsIds = detailsRows.map(d => d.id);
|
||||
const trainings = await Training.findAll({ where: { project_details_id: detailsIds } });
|
||||
return res.json(trainings);
|
||||
} else {
|
||||
// Return all trainings if no project_id is specified
|
||||
const trainings = await Training.findAll();
|
||||
return res.json(trainings);
|
||||
}
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to fetch trainings', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// DELETE endpoint to remove a training by id
|
||||
router.delete('/trainings/:id', async (req, res) => {
|
||||
try {
|
||||
const Training = require('../models/training.js');
|
||||
const id = req.params.id;
|
||||
const deleted = await Training.destroy({ where: { id } });
|
||||
if (deleted) {
|
||||
res.json({ message: 'Training deleted' });
|
||||
} else {
|
||||
res.status(404).json({ message: 'Training not found' });
|
||||
}
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to delete training', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// DELETE endpoint to remove a training project and all related entries
|
||||
router.delete('/training-projects/:id', async (req, res) => {
|
||||
try {
|
||||
const projectId = req.params.id;
|
||||
const TrainingProject = require('../models/TrainingProject.js');
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const Training = require('../models/training.js');
|
||||
// Find details row(s) for this project
|
||||
const detailsRows = await TrainingProjectDetails.findAll({ where: { project_id: projectId } });
|
||||
const detailsIds = detailsRows.map(d => d.id);
|
||||
// Delete all trainings linked to these details
|
||||
if (detailsIds.length > 0) {
|
||||
await Training.destroy({ where: { project_details_id: detailsIds } });
|
||||
await TrainingProjectDetails.destroy({ where: { project_id: projectId } });
|
||||
}
|
||||
// Delete the project itself
|
||||
const deleted = await TrainingProject.destroy({ where: { project_id: projectId } });
|
||||
if (deleted) {
|
||||
res.json({ message: 'Training project and all related entries deleted' });
|
||||
} else {
|
||||
res.status(404).json({ message: 'Training project not found' });
|
||||
}
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Failed to delete training project', error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
@@ -130,11 +130,17 @@ def start_yolox_training():
|
||||
if (training.transfer_learning and
|
||||
isinstance(training.transfer_learning, str) and
|
||||
training.transfer_learning.lower() == 'coco'):
|
||||
model_arg = f'-c {yolox_main_dir}/pretrained/{training.selected_model}.pth'
|
||||
# Use yolox_path setting to construct pretrained model path
|
||||
model_path = os.path.join(yolox_main_dir, 'pretrained', f'{training.selected_model}.pth')
|
||||
model_path = model_path.replace('\\', '/') # Use forward slashes for command line
|
||||
model_arg = f'-c {model_path}'
|
||||
elif (training.selected_model and
|
||||
training.selected_model.lower() == 'coco' and
|
||||
(not training.transfer_learning or training.transfer_learning == False)):
|
||||
model_arg = f'-c {yolox_main_dir}/pretrained/{training.selected_model}.pth'
|
||||
# Use yolox_path setting to construct pretrained model path
|
||||
model_path = os.path.join(yolox_main_dir, 'pretrained', f'{training.selected_model}.pth')
|
||||
model_path = model_path.replace('\\', '/') # Use forward slashes for command line
|
||||
model_arg = f'-c {model_path}'
|
||||
|
||||
# Build base training arguments
|
||||
train_args = f'-f {exp_file_path} -d 1 -b 8 --fp16 --cache'
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
const API_URL = 'http://192.168.1.19:8080/api';
|
||||
const API_TOKEN = 'c1cef980b7c73004f4ee880a42839313b863869f';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
async function fetchLableStudioProject(projectid) {
|
||||
// 1. Trigger export
|
||||
const exportUrl = `${API_URL}/projects/${projectid}/export?exportType=JSON_MIN`;
|
||||
const headers = { Authorization: `Token ${API_TOKEN}` };
|
||||
let res = await fetch(exportUrl, { headers });
|
||||
if (!res.ok) {
|
||||
let errorText = await res.text().catch(() => '');
|
||||
console.error(`Failed to trigger export: ${res.status} ${res.statusText} - ${errorText}`);
|
||||
throw new Error(`Failed to trigger export: ${res.status} ${res.statusText}`);
|
||||
}
|
||||
let data = await res.json();
|
||||
// If data is an array, it's ready
|
||||
if (Array.isArray(data)) return data;
|
||||
// If not, poll for the export file
|
||||
let fileUrl = data.download_url || data.url || null;
|
||||
let tries = 0;
|
||||
while (!fileUrl && tries < 20) {
|
||||
await new Promise(r => setTimeout(r, 2000));
|
||||
res = await fetch(exportUrl, { headers });
|
||||
if (!res.ok) {
|
||||
let errorText = await res.text().catch(() => '');
|
||||
console.error(`Failed to poll export: ${res.status} ${res.statusText} - ${errorText}`);
|
||||
throw new Error(`Failed to poll export: ${res.status} ${res.statusText}`);
|
||||
}
|
||||
data = await res.json();
|
||||
fileUrl = data.download_url || data.url || null;
|
||||
tries++;
|
||||
}
|
||||
if (!fileUrl) throw new Error('Label Studio export did not become ready');
|
||||
// 2. Download the export file
|
||||
res = await fetch(fileUrl.startsWith('http') ? fileUrl : `${API_URL.replace('/api','')}${fileUrl}`, { headers });
|
||||
if (!res.ok) {
|
||||
let errorText = await res.text().catch(() => '');
|
||||
console.error(`Failed to download export: ${res.status} ${res.statusText} - ${errorText}`);
|
||||
throw new Error(`Failed to download export: ${res.status} ${res.statusText}`);
|
||||
}
|
||||
return await res.json();
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function fetchProjectIdsAndTitles() {
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Token ${API_TOKEN}`,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
let errorText = await response.text().catch(() => '');
|
||||
console.error(`Failed to fetch projects: ${response.status} ${response.statusText} - ${errorText}`);
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!data.results || !Array.isArray(data.results)) {
|
||||
throw new Error('API response does not contain results array');
|
||||
}
|
||||
|
||||
// Extract id and title from each project
|
||||
const projects = data.results.map(project => ({
|
||||
id: project.id,
|
||||
title: project.title
|
||||
}));
|
||||
console.log(projects)
|
||||
return projects;
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch projects:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { fetchLableStudioProject, fetchProjectIdsAndTitles };
|
||||
|
||||
|
||||
|
||||
//getLableStudioProject(20)
|
||||
//fetchProjectIdsAndTitles()
|
||||
@@ -1,176 +0,0 @@
|
||||
const TrainingProject = require('../models/TrainingProject.js');
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js')
|
||||
const LabelStudioProject = require('../models/LabelStudioProject.js')
|
||||
const Annotation = require('../models/Annotation.js')
|
||||
const Images = require('../models/Images.js')
|
||||
const fs = require('fs');
|
||||
|
||||
|
||||
async function generateTrainingJson(trainingId){
|
||||
// trainingId is now project_details_id
|
||||
const trainingProjectDetails = await TrainingProjectDetails.findByPk(trainingId);
|
||||
if (!trainingProjectDetails) throw new Error('No TrainingProjectDetails found for project_details_id ' + trainingId);
|
||||
const detailsObj = trainingProjectDetails.get({ plain: true });
|
||||
// Get parent project for name
|
||||
const trainingProject = await TrainingProject.findByPk(detailsObj.project_id);
|
||||
// Get split percentages (assume they are stored as train_percent, valid_percent, test_percent)
|
||||
const trainPercent = detailsObj.train_percent || 85;
|
||||
const validPercent = detailsObj.valid_percent || 10;
|
||||
const testPercent = detailsObj.test_percent || 5;
|
||||
|
||||
let cocoImages = [];
|
||||
let cocoAnnotations = [];
|
||||
let cocoCategories = [];
|
||||
let categoryMap = {};
|
||||
let categoryId = 0;
|
||||
let imageid = 0;
|
||||
let annotationid = 0;
|
||||
|
||||
for (const cls of detailsObj.class_map) {
|
||||
const asgMap = [];
|
||||
const listAsg = cls[1];
|
||||
for(const asg of listAsg){
|
||||
asgMap.push ({ original: asg[0], mapped: asg[1] });
|
||||
// Build category list and mapping
|
||||
if (asg[1] && !(asg[1] in categoryMap)) {
|
||||
categoryMap[asg[1]] = categoryId;
|
||||
cocoCategories.push({ id: categoryId, name: asg[1], supercategory: '' });
|
||||
categoryId++;
|
||||
}
|
||||
}
|
||||
const images = await Images.findAll({ where: { project_id: cls[0] } });
|
||||
for(const image of images){
|
||||
imageid += 1;
|
||||
let fileName = image.image_path;
|
||||
if (fileName.includes('%20')) {
|
||||
fileName = fileName.replace(/%20/g, ' ');
|
||||
}
|
||||
if (fileName && fileName.startsWith('/data/local-files/?d=')) {
|
||||
fileName = fileName.replace('/data/local-files/?d=', '');
|
||||
fileName = fileName.replace('/home/kitraining/home/kitraining/', '');
|
||||
}
|
||||
if (fileName && fileName.startsWith('home/kitraining/To_Annotate/')) {
|
||||
fileName = fileName.replace('home/kitraining/To_Annotate/','');
|
||||
}
|
||||
// Get annotations for this image
|
||||
const annotations = await Annotation.findAll({ where: { image_id: image.image_id } });
|
||||
// Use image.width and image.height from DB (populated from original_width/original_height)
|
||||
cocoImages.push({
|
||||
id: imageid,
|
||||
file_name: fileName,
|
||||
width: image.width || 0,
|
||||
height: image.height || 0
|
||||
});
|
||||
for (const annotation of annotations) {
|
||||
// Translate class name using asgMap
|
||||
let mappedClass = annotation.Label;
|
||||
for (const mapEntry of asgMap) {
|
||||
if (annotation.Label === mapEntry.original) {
|
||||
mappedClass = mapEntry.mapped;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Only add annotation if mappedClass is valid
|
||||
if (mappedClass && mappedClass in categoryMap) {
|
||||
annotationid += 1;
|
||||
let area = 0;
|
||||
if (annotation.width && annotation.height) {
|
||||
area = annotation.width * annotation.height;
|
||||
}
|
||||
cocoAnnotations.push({
|
||||
id: annotationid,
|
||||
image_id: imageid,
|
||||
category_id: categoryMap[mappedClass],
|
||||
bbox: [annotation.x, annotation.y, annotation.width, annotation.height],
|
||||
area: area,
|
||||
iscrowd: annotation.iscrowd || 0
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Shuffle images for random split using seed
|
||||
function seededRandom(seed) {
|
||||
let x = Math.sin(seed++) * 10000;
|
||||
return x - Math.floor(x);
|
||||
}
|
||||
function shuffle(array, seed) {
|
||||
for (let i = array.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(seededRandom(seed + i) * (i + 1));
|
||||
[array[i], array[j]] = [array[j], array[i]];
|
||||
}
|
||||
}
|
||||
// Use seed from detailsObj if present, else default to 42
|
||||
const splitSeed = detailsObj.seed !== undefined && detailsObj.seed !== null ? Number(detailsObj.seed) : 42;
|
||||
shuffle(cocoImages, splitSeed);
|
||||
|
||||
// Split images
|
||||
const totalImages = cocoImages.length;
|
||||
const trainCount = Math.floor(totalImages * trainPercent / 100);
|
||||
const validCount = Math.floor(totalImages * validPercent / 100);
|
||||
const testCount = totalImages - trainCount - validCount;
|
||||
|
||||
const trainImages = cocoImages.slice(0, trainCount);
|
||||
const validImages = cocoImages.slice(trainCount, trainCount + validCount);
|
||||
const testImages = cocoImages.slice(trainCount + validCount);
|
||||
|
||||
// Helper to get image ids for each split
|
||||
const trainImageIds = new Set(trainImages.map(img => img.id));
|
||||
const validImageIds = new Set(validImages.map(img => img.id));
|
||||
const testImageIds = new Set(testImages.map(img => img.id));
|
||||
|
||||
// Split annotations
|
||||
const trainAnnotations = cocoAnnotations.filter(ann => trainImageIds.has(ann.image_id));
|
||||
const validAnnotations = cocoAnnotations.filter(ann => validImageIds.has(ann.image_id));
|
||||
const testAnnotations = cocoAnnotations.filter(ann => testImageIds.has(ann.image_id));
|
||||
|
||||
// Build final COCO JSONs with info section
|
||||
const buildCocoJson = (images, annotations, categories) => ({
|
||||
images,
|
||||
annotations,
|
||||
categories
|
||||
});
|
||||
|
||||
// Build COCO JSONs with info section
|
||||
const trainJson = buildCocoJson(trainImages, trainAnnotations, cocoCategories);
|
||||
const validJson = buildCocoJson(validImages, validAnnotations, cocoCategories);
|
||||
const testJson = buildCocoJson(testImages, testAnnotations, cocoCategories);
|
||||
|
||||
// Create output directory: projectname/trainingid/annotations
|
||||
const projectName = trainingProject && trainingProject.name ? trainingProject.name.replace(/\s+/g, '_') : `project_${detailsObj.project_id}`;
|
||||
const outDir = `${projectName}/${trainingId}`;
|
||||
const annotationsDir = `/home/kitraining/To_Annotate/annotations`;
|
||||
if (!fs.existsSync(annotationsDir)) {
|
||||
fs.mkdirSync(annotationsDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Write to files in the annotations directory
|
||||
const trainPath = `${annotationsDir}/coco_project_${trainingId}_train.json`;
|
||||
const validPath = `${annotationsDir}/coco_project_${trainingId}_valid.json`;
|
||||
const testPath = `${annotationsDir}/coco_project_${trainingId}_test.json`;
|
||||
fs.writeFileSync(trainPath, JSON.stringify(trainJson, null, 2));
|
||||
fs.writeFileSync(validPath, JSON.stringify(validJson, null, 2));
|
||||
fs.writeFileSync(testPath, JSON.stringify(testJson, null, 2));
|
||||
console.log(`COCO JSON splits written to ${annotationsDir} for trainingId ${trainingId}`);
|
||||
|
||||
|
||||
|
||||
// Also generate inference exp.py in the same output directory as exp.py (project folder in workspace)
|
||||
const { generateYoloxInferenceExp } = require('./generate-yolox-exp');
|
||||
const path = require('path');
|
||||
const projectFolder = path.join(__dirname, '..', projectName, String(trainingId));
|
||||
if (!fs.existsSync(projectFolder)) {
|
||||
fs.mkdirSync(projectFolder, { recursive: true });
|
||||
}
|
||||
const inferenceExpPath = path.join(projectFolder, 'exp_infer.py');
|
||||
generateYoloxInferenceExp(trainingId).then(expContent => {
|
||||
fs.writeFileSync(inferenceExpPath, expContent);
|
||||
console.log(`Inference exp.py written to ${inferenceExpPath}`);
|
||||
}).catch(err => {
|
||||
console.error('Failed to generate inference exp.py:', err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
module.exports = {generateTrainingJson};
|
||||
@@ -1,135 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const Training = require('../models/training.js');
|
||||
const TrainingProject = require('../models/TrainingProject.js');
|
||||
|
||||
// Remove Python comments and legacy code
|
||||
const exp_names = [
|
||||
'YOLOX-s',
|
||||
'YOLOX-m',
|
||||
'YOLOX-l',
|
||||
'YOLOX-x',
|
||||
'YOLOX-Darknet53', //todo
|
||||
'YOLOX-Nano',
|
||||
'YOLOX-Tiny'
|
||||
]
|
||||
|
||||
//TODO: Clean up generation of exp_names.py and remove second exp creation!!!
|
||||
|
||||
|
||||
// Refactored: Accept trainingId, fetch info from DB
|
||||
async function generateYoloxExp(trainingId) {
|
||||
// Fetch training row from DB by project_details_id if not found by PK
|
||||
let training = await Training.findByPk(trainingId);
|
||||
if (!training) {
|
||||
training = await Training.findOne({ where: { project_details_id: trainingId } });
|
||||
}
|
||||
if (!training) throw new Error('Training not found for trainingId or project_details_id: ' + trainingId);
|
||||
|
||||
// If transfer_learning is 'coco', just return the path to the default exp.py
|
||||
if (training.transfer_learning === 'coco') {
|
||||
const selectedModel = training.selected_model.toLowerCase().replace('-', '_');
|
||||
const expSourcePath = `/home/kitraining/Yolox/YOLOX-main/exps/default/${selectedModel}.py`;
|
||||
if (!fs.existsSync(expSourcePath)) {
|
||||
throw new Error(`Default exp.py not found for model: ${selectedModel} at ${expSourcePath}`);
|
||||
}
|
||||
// Copy to project folder (e.g., /home/kitraining/coco_tool/backend/project_XX/YY/exp.py)
|
||||
const projectDetailsId = training.project_details_id;
|
||||
const projectFolder = path.resolve(__dirname, `../project_23/${projectDetailsId}`);
|
||||
if (!fs.existsSync(projectFolder)) {
|
||||
fs.mkdirSync(projectFolder, { recursive: true });
|
||||
}
|
||||
const expDestPath = path.join(projectFolder, 'exp.py');
|
||||
fs.copyFileSync(expSourcePath, expDestPath);
|
||||
return { type: 'default', expPath: expDestPath };
|
||||
}
|
||||
|
||||
// If transfer_learning is 'sketch', generate a custom exp.py as before
|
||||
if (training.transfer_learning === 'sketch') {
|
||||
// ...existing custom exp.py generation logic here (copy from previous implementation)...
|
||||
// For brevity, you can call generateYoloxInferenceExp or similar here, or inline the logic.
|
||||
// Example:
|
||||
const expContent = await generateYoloxInferenceExp(trainingId);
|
||||
return { type: 'custom', expContent };
|
||||
}
|
||||
|
||||
throw new Error('Unknown transfer_learning type: ' + training.transfer_learning);
|
||||
}
|
||||
|
||||
async function saveYoloxExp(trainingId, outPath) {
|
||||
const expResult = await generateYoloxExp(trainingId);
|
||||
if (expResult.type === 'custom' && expResult.expContent) {
|
||||
fs.writeFileSync(outPath, expResult.expContent);
|
||||
return outPath;
|
||||
} else if (expResult.type === 'default' && expResult.expPath) {
|
||||
// Optionally copy the file if outPath is different
|
||||
if (expResult.expPath !== outPath) {
|
||||
fs.copyFileSync(expResult.expPath, outPath);
|
||||
}
|
||||
return outPath;
|
||||
} else {
|
||||
throw new Error('Unknown expResult type or missing content');
|
||||
}
|
||||
}
|
||||
|
||||
// Generate a second exp.py for inference, using the provided template and DB values
|
||||
async function generateYoloxInferenceExp(trainingId, options = {}) {
|
||||
let training = await Training.findByPk(trainingId);
|
||||
if (!training) {
|
||||
training = await Training.findOne({ where: { project_details_id: trainingId } });
|
||||
}
|
||||
if (!training) throw new Error('Training not found for trainingId or project_details_id: ' + trainingId);
|
||||
// Always use the trainingId (project_details_id) for annotation file names
|
||||
const projectDetailsId = training.project_details_id;
|
||||
const dataDir = options.data_dir || '/home/kitraining/To_Annotate/';
|
||||
const trainAnn = options.train_ann || `coco_project_${trainingId}_train.json`;
|
||||
const valAnn = options.val_ann || `coco_project_${trainingId}_valid.json`;
|
||||
const testAnn = options.test_ann || `coco_project_${trainingId}_test.json`;
|
||||
// Get num_classes from TrainingProject.classes JSON
|
||||
let numClasses = 80;
|
||||
try {
|
||||
const trainingProject = await TrainingProject.findByPk(projectDetailsId);
|
||||
if (trainingProject && trainingProject.classes) {
|
||||
let classesArr = trainingProject.classes;
|
||||
if (typeof classesArr === 'string') {
|
||||
classesArr = JSON.parse(classesArr);
|
||||
}
|
||||
if (Array.isArray(classesArr)) {
|
||||
numClasses = classesArr.filter(c => c !== null && c !== undefined && c !== '').length;
|
||||
} else if (typeof classesArr === 'object' && classesArr !== null) {
|
||||
numClasses = Object.keys(classesArr).filter(k => classesArr[k] !== null && classesArr[k] !== undefined && classesArr[k] !== '').length;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Could not determine num_classes from TrainingProject.classes:', e);
|
||||
}
|
||||
const depth = options.depth || training.depth || 1.00;
|
||||
const width = options.width || training.width || 1.00;
|
||||
const inputSize = options.input_size || training.input_size || [640, 640];
|
||||
const mosaicScale = options.mosaic_scale || training.mosaic_scale || [0.1, 2];
|
||||
const randomSize = options.random_size || training.random_size || [10, 20];
|
||||
const testSize = options.test_size || training.test_size || [640, 640];
|
||||
const expName = options.exp_name || 'inference_exp';
|
||||
const enableMixup = options.enable_mixup !== undefined ? options.enable_mixup : false;
|
||||
let expContent = '';
|
||||
expContent += `#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport os\n\nfrom yolox.exp import Exp as MyExp\n\n\nclass Exp(MyExp):\n def __init__(self):\n super(Exp, self).__init__()\n self.data_dir = "${dataDir}"\n self.train_ann = "${trainAnn}"\n self.val_ann = "${valAnn}"\n self.test_ann = "coco_project_${trainingId}_test.json"\n self.num_classes = ${numClasses}\n`;
|
||||
// Set pretrained_ckpt if transfer_learning is 'coco'
|
||||
if (training.transfer_learning && typeof training.transfer_learning === 'string' && training.transfer_learning.toLowerCase() === 'coco') {
|
||||
const yoloxBaseDir = '/home/kitraining/Yolox/YOLOX-main';
|
||||
const selectedModel = training.selected_model ? training.selected_model.replace(/\.pth$/i, '') : '';
|
||||
if (selectedModel) {
|
||||
expContent += ` self.pretrained_ckpt = r'${yoloxBaseDir}/pretrained/${selectedModel}.pth'\n`;
|
||||
}
|
||||
}
|
||||
expContent += ` self.depth = ${depth}\n self.width = ${width}\n self.input_size = (${Array.isArray(inputSize) ? inputSize.join(', ') : inputSize})\n self.mosaic_scale = (${Array.isArray(mosaicScale) ? mosaicScale.join(', ') : mosaicScale})\n self.random_size = (${Array.isArray(randomSize) ? randomSize.join(', ') : randomSize})\n self.test_size = (${Array.isArray(testSize) ? testSize.join(', ') : testSize})\n self.exp_name = os.path.split(os.path.realpath(__file__))[1].split(".")[0]\n self.enable_mixup = ${enableMixup ? 'True' : 'False'}\n`;
|
||||
return expContent;
|
||||
}
|
||||
|
||||
// Save inference exp.py to a custom path
|
||||
async function saveYoloxInferenceExp(trainingId, outPath, options = {}) {
|
||||
const expContent = await generateYoloxInferenceExp(trainingId, options);
|
||||
fs.writeFileSync(outPath, expContent);
|
||||
return outPath;
|
||||
}
|
||||
|
||||
module.exports = { generateYoloxExp, saveYoloxExp, generateYoloxInferenceExp, saveYoloxInferenceExp };
|
||||
@@ -1,48 +0,0 @@
|
||||
const Training = require('../models/training.js');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
async function pushYoloxExpToDb(settings) {
|
||||
// Normalize boolean and array fields for DB
|
||||
const normalized = { ...settings };
|
||||
// Map 'act' from frontend to 'activation' for DB
|
||||
if (normalized.act !== undefined) {
|
||||
normalized.activation = normalized.act;
|
||||
delete normalized.act;
|
||||
}
|
||||
// Convert 'on'/'off' to boolean for save_history_ckpt
|
||||
if (typeof normalized.save_history_ckpt === 'string') {
|
||||
normalized.save_history_ckpt = normalized.save_history_ckpt === 'on' ? true : false;
|
||||
}
|
||||
// Convert comma-separated strings to arrays for input_size, test_size, mosaic_scale, mixup_scale
|
||||
['input_size', 'test_size', 'mosaic_scale', 'mixup_scale'].forEach(key => {
|
||||
if (typeof normalized[key] === 'string') {
|
||||
const arr = normalized[key].split(',').map(v => parseFloat(v.trim()));
|
||||
normalized[key] = arr.length === 1 ? arr[0] : arr;
|
||||
}
|
||||
});
|
||||
// Find TrainingProjectDetails for this project
|
||||
const TrainingProjectDetails = require('../models/TrainingProjectDetails.js');
|
||||
const details = await TrainingProjectDetails.findOne({ where: { project_id: normalized.project_id } });
|
||||
if (!details) throw new Error('TrainingProjectDetails not found for project_id ' + normalized.project_id);
|
||||
normalized.project_details_id = details.id;
|
||||
// Create DB row
|
||||
const training = await Training.create(normalized);
|
||||
return training;
|
||||
}
|
||||
|
||||
async function generateYoloxExpFromDb(trainingId) {
|
||||
// Fetch training row from DB
|
||||
const training = await Training.findByPk(trainingId);
|
||||
if (!training) throw new Error('Training not found');
|
||||
// Template for exp.py
|
||||
const expTemplate = `#!/usr/bin/env python3\n# Copyright (c) Megvii Inc. All rights reserved.\n\nimport os\nimport random\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\n\nfrom .base_exp import BaseExp\n\n__all__ = [\"Exp\", \"check_exp_value\"]\n\nclass Exp(BaseExp):\n def __init__(self):\n super().__init__()\n\n # ---------------- model config ---------------- #\n self.num_classes = ${training.num_classes || 80}\n self.depth = ${training.depth || 1.00}\n self.width = ${training.width || 1.00}\n self.act = \"${training.activation || training.act || 'silu'}\"\n\n # ---------------- dataloader config ---------------- #\n self.data_num_workers = ${training.data_num_workers || 4}\n self.input_size = (${Array.isArray(training.input_size) ? training.input_size.join(', ') : '640, 640'})\n self.multiscale_range = ${training.multiscale_range || 5}\n self.data_dir = ${training.data_dir ? `\"${training.data_dir}\"` : 'None'}\n self.train_ann = \"${training.train_ann || 'instances_train2017.json'}\"\n self.val_ann = \"${training.val_ann || 'instances_val2017.json'}\"\n self.test_ann = \"${training.test_ann || 'instances_test2017.json'}\"\n\n # --------------- transform config ----------------- #\n self.mosaic_prob = ${training.mosaic_prob !== undefined ? training.mosaic_prob : 1.0}\n self.mixup_prob = ${training.mixup_prob !== undefined ? training.mixup_prob : 1.0}\n self.hsv_prob = ${training.hsv_prob !== undefined ? training.hsv_prob : 1.0}\n self.flip_prob = ${training.flip_prob !== undefined ? training.flip_prob : 0.5}\n self.degrees = ${training.degrees !== undefined ? training.degrees : 10.0}\n self.translate = ${training.translate !== undefined ? training.translate : 0.1}\n self.mosaic_scale = (${Array.isArray(training.mosaic_scale) ? training.mosaic_scale.join(', ') : '0.1, 2'})\n self.enable_mixup = ${training.enable_mixup !== undefined ? training.enable_mixup : true}\n self.mixup_scale = (${Array.isArray(training.mixup_scale) ? training.mixup_scale.join(', ') : '0.5, 1.5'})\n self.shear = ${training.shear !== undefined ? training.shear : 2.0}\n\n # -------------- training config --------------------- #\n self.warmup_epochs = ${training.warmup_epochs !== undefined ? training.warmup_epochs : 5}\n self.max_epoch = ${training.max_epoch !== undefined ? training.max_epoch : 300}\n self.warmup_lr = ${training.warmup_lr !== undefined ? training.warmup_lr : 0}\n self.min_lr_ratio = ${training.min_lr_ratio !== undefined ? training.min_lr_ratio : 0.05}\n self.basic_lr_per_img = ${training.basic_lr_per_img !== undefined ? training.basic_lr_per_img : 0.01 / 64.0}\n self.scheduler = \"${training.scheduler || 'yoloxwarmcos'}\"\n self.no_aug_epochs = ${training.no_aug_epochs !== undefined ? training.no_aug_epochs : 15}\n self.ema = ${training.ema !== undefined ? training.ema : true}\n self.weight_decay = ${training.weight_decay !== undefined ? training.weight_decay : 5e-4}\n self.momentum = ${training.momentum !== undefined ? training.momentum : 0.9}\n self.print_interval = ${training.print_interval !== undefined ? training.print_interval : 10}\n self.eval_interval = ${training.eval_interval !== undefined ? training.eval_interval : 10}\n self.save_history_ckpt = ${training.save_history_ckpt !== undefined ? training.save_history_ckpt : true}\n self.exp_name = os.path.split(os.path.realpath(__file__))[1].split(\".\")[0]\n\n # ----------------- testing config ------------------ #\n self.test_size = (${Array.isArray(training.test_size) ? training.test_size.join(', ') : '640, 640'})\n self.test_conf = ${training.test_conf !== undefined ? training.test_conf : 0.01}\n self.nmsthre = ${training.nmsthre !== undefined ? training.nmsthre : 0.65}\n\n # ... rest of the template ...\n\ndef check_exp_value(exp: Exp):\n h, w = exp.input_size\n assert h % 32 == 0 and w % 32 == 0, \"input size must be multiples of 32\"\n`;
|
||||
// Save to file in output directory
|
||||
const outDir = path.join(__dirname, '../../', training.project_id ? `project_${training.project_id}/${trainingId}` : 'exp_files');
|
||||
if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
|
||||
const filePath = path.join(outDir, 'exp.py');
|
||||
fs.writeFileSync(filePath, expTemplate);
|
||||
return filePath;
|
||||
}
|
||||
|
||||
module.exports = { pushYoloxExpToDb, generateYoloxExpFromDb };
|
||||
@@ -1,120 +0,0 @@
|
||||
const sequelize = require('../database/database.js');
|
||||
const { Project, Img, Ann } = require('../models');
|
||||
const { fetchLableStudioProject, fetchProjectIdsAndTitles } = require('./fetch-labelstudio.js');
|
||||
|
||||
const updateStatus = { running: false };
|
||||
|
||||
async function seedLabelStudio() {
|
||||
updateStatus.running = true;
|
||||
console.log('Seeding started');
|
||||
try {
|
||||
await sequelize.sync();
|
||||
const projects = await fetchProjectIdsAndTitles();
|
||||
|
||||
for (const project of projects) {
|
||||
console.log(`Processing project ${project.id} (${project.title})`);
|
||||
|
||||
// Upsert project in DB
|
||||
await Project.upsert({ project_id: project.id, title: project.title });
|
||||
|
||||
// Fetch project data (annotations array)
|
||||
const data = await fetchLableStudioProject(project.id);
|
||||
if (!Array.isArray(data) || data.length === 0) {
|
||||
console.log(`No annotation data for project ${project.id}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Remove old images and annotations for this project
|
||||
const oldImages = await Img.findAll({ where: { project_id: project.id } });
|
||||
const oldImageIds = oldImages.map(img => img.image_id);
|
||||
if (oldImageIds.length > 0) {
|
||||
await Ann.destroy({ where: { image_id: oldImageIds } });
|
||||
await Img.destroy({ where: { project_id: project.id } });
|
||||
console.log(`Deleted ${oldImageIds.length} old images and their annotations for project ${project.id}`);
|
||||
}
|
||||
|
||||
// Prepare arrays
|
||||
const imagesBulk = [];
|
||||
const annsBulk = [];
|
||||
|
||||
for (const ann of data) {
|
||||
// Extract width/height
|
||||
let width = null;
|
||||
let height = null;
|
||||
if (Array.isArray(ann.label_rectangles) && ann.label_rectangles.length > 0) {
|
||||
width = ann.label_rectangles[0].original_width;
|
||||
height = ann.label_rectangles[0].original_height;
|
||||
} else if (Array.isArray(ann.label) && ann.label.length > 0 && ann.label[0].original_width && ann.label[0].original_height) {
|
||||
width = ann.label[0].original_width;
|
||||
height = ann.label[0].original_height;
|
||||
}
|
||||
|
||||
// Only push image and annotations if width and height are valid
|
||||
if (width && height) {
|
||||
imagesBulk.push({
|
||||
project_id: project.id,
|
||||
image_path: ann.image,
|
||||
width,
|
||||
height
|
||||
});
|
||||
|
||||
// Handle multiple annotations per image
|
||||
if (Array.isArray(ann.label_rectangles)) {
|
||||
for (const ann_detail of ann.label_rectangles) {
|
||||
annsBulk.push({
|
||||
image_path: ann.image,
|
||||
x: (ann_detail.x * width) / 100,
|
||||
y: (ann_detail.y * height) / 100,
|
||||
width: (ann_detail.width * width) / 100,
|
||||
height: (ann_detail.height * height) / 100,
|
||||
Label: Array.isArray(ann_detail.rectanglelabels) ? (ann_detail.rectanglelabels[0] || 'unknown') : (ann_detail.rectanglelabels || 'unknown')
|
||||
});
|
||||
}
|
||||
} else if (Array.isArray(ann.label)) {
|
||||
for (const ann_detail of ann.label) {
|
||||
annsBulk.push({
|
||||
image_path: ann.image,
|
||||
x: (ann_detail.x * width) / 100,
|
||||
y: (ann_detail.y * height) / 100,
|
||||
width: (ann_detail.width * width) / 100,
|
||||
height: (ann_detail.height * height) / 100,
|
||||
Label: Array.isArray(ann_detail.rectanglelabels) ? (ann_detail.rectanglelabels[0] || 'unknown') : (ann_detail.rectanglelabels || 'unknown')
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 1) Insert images and get generated IDs
|
||||
const insertedImages = await Img.bulkCreate(imagesBulk, { returning: true });
|
||||
|
||||
// 2) Map image_path -> image_id
|
||||
const imageMap = {};
|
||||
for (const img of insertedImages) {
|
||||
imageMap[img.image_path] = img.image_id;
|
||||
}
|
||||
|
||||
// 3) Assign correct image_id to each annotation
|
||||
for (const ann of annsBulk) {
|
||||
ann.image_id = imageMap[ann.image_path];
|
||||
delete ann.image_path; // cleanup
|
||||
}
|
||||
|
||||
// 4) Insert annotations
|
||||
await Ann.bulkCreate(annsBulk);
|
||||
|
||||
console.log(`Inserted ${imagesBulk.length} images and ${annsBulk.length} annotations for project ${project.id}`);
|
||||
}
|
||||
|
||||
console.log('Seeding done');
|
||||
return { success: true, message: 'Data inserted successfully!' };
|
||||
} catch (error) {
|
||||
console.error('Error inserting data:', error);
|
||||
return { success: false, message: error.message };
|
||||
} finally {
|
||||
updateStatus.running = false;
|
||||
console.log('updateStatus.running set to false');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { seedLabelStudio, updateStatus };
|
||||
@@ -553,7 +553,7 @@ document.getElementById('parameters-form').addEventListener('submit', async func
|
||||
}
|
||||
// Add project id if available
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const projectId = urlParams.get('id');
|
||||
const projectId = urlParams.get('project_id') || urlParams.get('id'); // Support both parameter names
|
||||
if (projectId) formData.append('project_id', projectId);
|
||||
// Send to backend
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user