Skip to content

Commit

Permalink
Merge pull request #10 from mrl-amrl/yolo-format-filename
Browse files Browse the repository at this point in the history
fix(yoloannotation): just last file extension be replaced with txt no…
  • Loading branch information
a-sharifi authored Jun 26, 2022
2 parents 12db76e + b177956 commit ed16dfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion preimutils/object_detection/yolo/coco2yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def coco2yolo(self):
def _save_txt(self, anno_dict):
for k, v in anno_dict.items():
ext_name = v[0][0].split(".")[-1]
file_name = v[0][0].replace(ext_name, 'txt')
file_name = v[0][0][:-len(ext_name)] + 'txt'
with open(os.path.join(self.output, file_name), 'w', encoding='utf-8') as f:
for obj in v:
cat_name = self.coco_id_name_map.get(obj[1])
Expand Down

0 comments on commit ed16dfa

Please sign in to comment.