GaoangW / TNT

GNU General Public License v3.0
74 stars 17 forks source link

data preprocessing #6

Open Imagesnn opened 5 years ago

Imagesnn commented 5 years ago

Hello, I have some problems preprocessing the data.There are a lot of .m files in TNT/General, but I don't know if I just need to use these three .m files, they are TNT/General/MOT_to_UA_Detrac.m, TNT/General/crop_UA_Detrac.m, and TNT/General/create_pair.m. Can you give a detailed example of the format in which these three functions need to be passed in? Or you can give detailed commands to call the functions. Thank you!

woshiwoyali commented 5 years ago

hi

Hello,

How does TNT/General/create_pair.m in Part 3 run?

When it runs, it keeps reporting errors.

Error using:

For colon operator with char operator, first and last operands must be char

GaoangW commented 5 years ago

@Imagesnn You can set the General folder into your Matlab path. Then you can call these three functions. The inputs are explained inside each .m file. For example, MOT_to_UA_Detrac('.txt', '1', 'save_dir', [800,600]); create_pair('dataset_dir', 'save_dir', 300, 10); crop_UA_Detrac('gt_path.mat', '1', 'the folder contains the sequence images', 'jpg', 'save_folder');

GaoangW commented 5 years ago

@woshiwoyali Maybe it is because the input directory is not correct. The dataset_dir should contain several subfolders. Each subfolder should have several png images from the same identity/class. You can provide more bug information if you still get the error.

woshiwoyali commented 5 years ago

Hi   How should I understand the last two parameters in the create_pair method, num_pair, n_fold? Thank you!

woshiwoyali commented 5 years ago

嗨! 在第六步,Train 2D tracking. 需要输入的 路径

MAT_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/gt_mat' img_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT17Det/train' temp_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/temp' triplet_model = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT_appearance' save_dir = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT_2d/model.ckpt'

请问这些数据是如何得到的,在前面的五部操作中并没有得到这些数据。 麻烦对于第六步的五个输入源做一下解释,谢谢!

GaoangW commented 5 years ago

@woshiwoyali

  1. num_pair is the number of positive pairs and negative pairs in the faceNet evaluation. n_fold is the number of folds used in the cross validation.
  2. MAT_folder is the folder that contains the tracking ground truth ".mat" files generated from previous steps.
  3. img_folder contains the input image sequences.
  4. temp_folder will store the intermediate cropped results. You can set it as an empty folder.
  5. triplet_model contains the embedding model learned from faceNet.
  6. save_dir is the directory where you want to save the trackletNet model. Let me know if you have other questions.
woshiwoyali commented 5 years ago

您好: 在第五步中 使用裁剪数据训练基于FaceNet的三重态外观模型。 在facenet项目中,下载LFW数据集【未对齐的人脸图像】,使用命令 python src/align/align_dataset_mtcnn.py \ ~/datasets/lfw/raw \ ~/datasets/lfw/lfw_mtcnnpy_160 \ --image_size 160 \ --margin 32 \ --random_order \ --gpu_memory_fraction 0.25 \ 可以将人脸图像数据裁剪、对齐。

下载预先训练的模型,20180402-114759。 里面包含 20180402-114759.pb model-20180402-114759.ckpt-275.data-00000-of-00001 model-20180402-114759.ckpt-275.index model-20180402-114759.meta

运行 python src/validate_on_lfw.py \ ~/datasets/lfw/lfw_mtcnnpy_160 \ ~/models/facenet/20180402-114759 \ --distance_metric 1 \ --use_flipped_images \ --subtract_mean \ --use_fixed_image_standardization 可以得到最终的精准度。

使用 compare.py 也可以对多张图片进行比对。

目前在第五步中出现的问题是:

使用align_dataset_mtcnn.py 貌似只能对人脸进行对齐处理, 数据集换成自己的汽车图像,不能进行对齐操作。 对齐操作中产成的结果为: bounding_boxes_XXX.txt revision_info,txt 以及裁剪对其后的图像文件夹。

貌似 预先训练的模型,20180402-114759。也只是针对于人脸检查的模型, 对于自己的汽车图像数据我需要怎么做呢?

对于 第六步中train_cnn_trajectory_2d.py 中使用到第五步中的结果: triplet_model = ' C:/ Users / tangz / OneDrive / Documents / Gaoang / MOT17 / MOT_appearance triplet_model 应该为第五步facenet中产生的哪个结果。

期待您的回答,谢谢!

karineip commented 4 years ago

Hello, Running TNT/General/MOT_to_UA_Detrac.m gives an error: it its not finding bboxOverlapRatio. Could you clarify where is the function bboxOverlapRatio?

Thank you!

syliabe commented 2 years ago

Bonjour, L' exécution de TNT/General/MOT_to_UA_Detrac.m génère une erreur : il ne trouve pas bboxOverlapRatio. Pourriez-vous préciser où se trouve la fonction bboxOverlapRatio ?

Merci!

Hello, I had the same problem have you found the solution please? thanks

ZhouAugustus commented 2 years ago

您好,请问您能详细讲一讲如何组织matlab代码中产生的那些数据吗?我通过这些代码,分别得到了一些pairs文件、mat文件、和一些剪裁后的图片数据文件,我仍将这些文件按MOT17Det/train/目录下的序列的不同而分开,这样做对吗?最后一步train_cnn_trajecctory文件中似乎只需要一个包含所有的mat的文件夹、模型文件和原数据集。我看到大家似乎还是用的lfw数据集来产生tripleloose模型文件,那么剪裁的图片及pairs文件我又该如何使用呢?

GaoangW commented 2 years ago

Bonjour, L' exécution de TNT/General/MOT_to_UA_Detrac.m génère une erreur : il ne trouve pas bboxOverlapRatio. Pourriez-vous préciser où se trouve la fonction bboxOverlapRatio ? Merci!

Hello, I had the same problem have you found the solution please? thanks

MOT_to_UA_Detrac.m has been just updated. Using "overlap" function instead would be OK.

GaoangW commented 2 years ago

您好: 在第五步中 使用裁剪数据训练基于FaceNet的三重态外观模型。 在facenet项目中,下载LFW数据集【未对齐的人脸图像】,使用命令 python src/align/align_dataset_mtcnn.py ~/datasets/lfw/raw ~/datasets/lfw/lfw_mtcnnpy_160 --image_size 160 --margin 32 --random_order --gpu_memory_fraction 0.25 可以将人脸图像数据裁剪、对齐。 下载预先训练的模型,20180402-114759。 里面包含 20180402-114759.pb model-20180402-114759.ckpt-275.data-00000-of-00001 model-20180402-114759.ckpt-275.index model-20180402-114759.meta 运行 python src/validate_on_lfw.py ~/datasets/lfw/lfw_mtcnnpy_160 ~/models/facenet/20180402-114759 --distance_metric 1 --use_flipped_images --subtract_mean --use_fixed_image_standardization 可以得到最终的精准度。 使用 compare.py 也可以对多张图片进行比对。 目前在第五步中出现的问题是: 使用align_dataset_mtcnn.py 貌似只能对人脸进行对齐处理, 数据集换成自己的汽车图像,不能进行对齐操作。 对齐操作中产成的结果为: bounding_boxes_XXX.txt revision_info,txt 以及裁剪对其后的图像文件夹。 貌似 预先训练的模型,20180402-114759。也只是针对于人脸检查的模型, 对于自己的汽车图像数据我需要怎么做呢? 对于 第六步中train_cnn_trajectory_2d.py 中使用到第五步中的结果: triplet_model = ' C:/ Users / tangz / OneDrive / Documents / Gaoang / MOT17 / MOT_appearance triplet_model 应该为第五步facenet中产生的哪个结果。 期待您的回答,谢谢!

请问您关于其他类型图片对齐的问题解决了吗?

你好,汽车的裁剪图片我没有现成的alignment代码,可以参考相关做car keypoint detection的工作,根据keypoint做alignment。或者直接将detection的结果进行最简单的resize处理。 第六步用facenet最终迭代产生的模型即可。

GaoangW commented 2 years ago

您好,请问您能详细讲一讲如何组织matlab代码中产生的那些数据吗?我通过这些代码,分别得到了一些pairs文件、mat文件、和一些剪裁后的图片数据文件,我仍将这些文件按MOT17Det/train/目录下的序列的不同而分开,这样做对吗?最后一步train_cnn_trajecctory文件中似乎只需要一个包含所有的mat的文件夹、模型文件和原数据集。我看到大家似乎还是用的lfw数据集来产生tripleloose模型文件,那么剪裁的图片及pairs文件我又该如何使用呢?

裁剪出来的图片和pairs是用于facenet训练及验证使用的。训练facenet是为了获取图片的embedding,代码在src文件夹下面。具体的训练可以参考https://github.com/davidsandberg/facenet. 之后在第六步中只需要输入mat文件路径、video的原始帧路径和训练好的facenet模型路径,temp_folder和save_dir是输出路径: MAT_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/gt_mat' img_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT17Det/train' temp_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/temp' triplet_model = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT_appearance' save_dir = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT_2d/model.ckpt'

ZhouAugustus commented 2 years ago

您好,请问您能详细讲一讲如何组织matlab代码中产生的那些数据吗?我通过这些代码,分别得到了一些pairs文件、mat文件、和一些剪裁后的图片数据文件,我仍将这些文件按MOT17Det/train/目录下的序列的不同而分开,这样做对吗?最后一步train_cnn_trajecctory文件中似乎只需要一个包含所有的mat的文件夹、模型文件和原数据集。我看到大家似乎还是用的lfw数据集来产生tripleloose模型文件,那么剪裁的图片及pairs文件我又该如何使用呢?

裁剪出来的图片和pairs是用于facenet训练及验证使用的。训练facenet是为了获取图片的embedding,代码在src文件夹下面。具体的训练可以参考https://github.com/davidsandberg/facenet. 之后在第六步中只需要输入mat文件路径、video的原始帧路径和训练好的facenet模型路径,temp_folder和save_dir是输出路径: MAT_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/gt_mat' img_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT17Det/train' temp_folder = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/temp' triplet_model = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT_appearance' save_dir = 'C:/Users/tangz/OneDrive/Documents/Gaoang/MOT17/MOT_2d/model.ckpt'

您好,感谢您的回答。我这里对于tracklet_utils_3c.py中前置参数同样有些不解,希望能再麻烦您给我讲解一下。 det_path = 'D:/Data/basketball_6943_results/det.txt'/*这个det中是什么?类似pairs.txt?/ gt_path = ''" img_folder = 'D:/Data/basketball_6943_results/img' crop_det_folder = 'D:/Data/basketball_6943_results/crop_det/'+seq_name+sub_seq_name triplet_model = 'D:/Data/UA-Detrac/UA_Detrca_model/MOT' seq_model = 'D:/Data/MOT/MOT_2d_v2/model.ckpt'/这个model怎么获得的?与triplet_model有什么关系吗?/ tracking_img_folder = 'D:/Data/basketball_6943_results/tracking_img/'+seq_name+sub_seq_name/为什么还有子系列?/ tracking_video_path = 'D:/Data/basketball_6943_results/tracking_video/'+seq_name+sub_seq_name+'.avi'/video_path与img需要同时存在吗?/ appear_mat_path = 'D:/Data/basketball_6943_results/appear_mat/'+seq_name+'.obj' txt_result_path = 'D:/Data/basketball_6943_results/txt_result/'+seq_name+sub_seq_name+'.txt'/这个又是什么?/ track_struct_path = 'D:/Data/basketball_6943_results/track_struct/'+seq_name+sub_seq_name+'.obj'/obj文件是做什么的?/