CaptainEven / MCMOT

Real time one-stage multi-class & multi-object tracking based on anchor-free detection and ReID
MIT License
390 stars 83 forks source link

Train on custom dataset #55

Closed pirahansiah closed 4 years ago

pirahansiah commented 4 years ago

I fallow the instruction of FairMOT to create the datasets for training. However, the "gen_labels_detrac_mcmot.py" file has several comments code. which one should I used to preparation my datasets ready to train.

if __name__ == '__main__':
    # preprocess(src_root='/mnt/diskb/even/Insight-MVT_Annotation_Train',
    #            dst_root='/mnt/diskb/even/dataset/DETRAC')
    #
    # gen_labels(xml_root='/mnt/diskb/even/DETRAC-Train-Annotations-XML',
    #            img_root='/mnt/diskb/even/dataset/DETRAC/images/train',
    #            label_root='/mnt/diskb/even/dataset/DETRAC/labels_with_ids/train',
    #            viz_root='/mnt/diskb/even/viz_result')

    # gen_dot_train_file(data_root='/mnt/diskb/even/dataset',
    #                    rel_path='/MCMOT/images',
    #                    out_root='/mnt/diskb/even/MCMOT/src/data',
    #                    f_name='mcmot.train')

    # cvt2voc_format(data_root='/mnt/diskb/even/dataset/MCMOT_DET')
    # pick_as_val(dot_train_f='/mnt/diskb/even/dataset/MCMOT/train_mcmot.txt')
    # pick_as_val(dot_train_f='/mnt/diskb/even/MCMOT/src/data/mcmot_det.train')

    # add_suffix_for_files(data_root='/mnt/diskb/even/MCMOT/results',
    #                      suffix='old',
    #                      mode='visdrone')

    # add_new_train_data(part_train_f_path='/mnt/diskb/maqiao/multiClass/c5_pc_20200714/train.txt',
    #                    data_root='/mnt/diskb/even/dataset/MCMOT_DET',
    #                    dot_train_f_path='/mnt/diskb/even/MCMOT/src/data/mcmot_det_bk.train',
    #                    dataset_prefix='/mnt/diskb/even/dataset/')

    # gen_dot_train_file_from_txt(txt_f_path='/users/duanyou/c5/all_pretrain/trainall.txt',
    #                             dst_root='/mnt/diskb/even/dataset/MCMOT_DET',
    #                             dot_train_f_path='/mnt/diskb/even/MCMOT/src/data/mcmot_det.train',
    #                             dataset_prefix='/mnt/diskb/even/dataset/')

    # clean_train_set(img_root='/mnt/diskb/even/dataset/DETRAC/images/train',
    #                 label_root='/mnt/diskb/even/dataset/DETRAC/labels_with_ids/train')
    #
    # count_files(img_root='/mnt/diskb/even/dataset/DETRAC/images/train',
    #             label_root='/mnt/diskb/even/dataset/DETRAC/labels_with_ids')

    print('Done')
CaptainEven commented 4 years ago

@pirahansiah If you need to train the DETRAC dataset, just use the py-script gen_labels_detrac.py image For custom dataset, just following the FairMOT's dataset generatin script will be ok. Remember to modify the class id of each label, wish you good luck!