We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3781b15 commit dbec210Copy full SHA for dbec210
yolov5_2_coco.py
@@ -157,11 +157,10 @@ def gen_dataset(self, img_paths, target_img_path, target_json, mode):
157
with open(target_json, 'w', encoding='utf-8') as f:
158
json.dump(json_data, f, ensure_ascii=False)
159
160
- def read_annotation(self, txtfile, img_id,
161
- height, width):
+ def read_annotation(self, txt_file, img_id, height, width):
162
annotation = []
163
- allinfo = read_txt(txtfile)
164
- for label_info in allinfo:
+ all_info = read_txt(txt_file)
+ for label_info in all_info:
165
# 遍历一张图中不同标注对象
166
label_info = label_info.split(" ")
167
if len(label_info) < 5:
@@ -208,7 +207,7 @@ def _get_annotation(vertex_info, height, width):
208
207
if __name__ == "__main__":
209
parser = argparse.ArgumentParser('Datasets converter from YOLOV5 to COCO')
210
parser.add_argument('--dir_path', type=str,
211
- default='datasets/tmp/YOLOV5',
+ default='datasets/YOLOV5',
212
help='Dataset root path')
213
args = parser.parse_args()
214
0 commit comments