-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat_and_convert_data.py
40 lines (28 loc) · 1.33 KB
/
format_and_convert_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Format Market-1501 training images and convert all the splits into TFRecords
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from datasets import convert_to_tfrecords
from datasets import format_market_train
from datasets import make_filename_list
from datasets.utils import *
FLAGS = tf.app.flags.FLAGS
split_name='bounding_box_test'#bounding_box_train bounding_box_test gt_bbox query
tf.app.flags.DEFINE_string('image_dir', 'D:/杭电/范老师/最新/Deep-Mutual-Learning-master/Market-1501-v15.09.15/'+split_name, None)
tf.app.flags.DEFINE_string('output_dir', 'D:/杭电/范老师/最新/Deep-Mutual-Learning-master/tfrecords_output/', None)
tf.app.flags.DEFINE_string('split_name', split_name, None)
def main(_):
#mkdir_if_missing(FLAGS.output_dir)
if FLAGS.split_name == 'bounding_box_train':
format_market_train.run(image_dir=FLAGS.image_dir)
make_filename_list.run(image_dir=FLAGS.image_dir,
output_dir=FLAGS.output_dir,
split_name=FLAGS.split_name)
convert_to_tfrecords.run(image_dir=FLAGS.image_dir,
output_dir=FLAGS.output_dir,
split_name=FLAGS.split_name)
if __name__ == '__main__':
tf.app.run()