Skip to content

Commit

Permalink
Update remove_space.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-ecm authored Feb 17, 2023
1 parent 4408024 commit 836113e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mAP/extra/remove_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--delimiter', type=str, help="delimiter to replace space (default: '-')", default='-')
parser.add_argument('-y', '--yes', action='store_true', help="force yes confirmation on yes/no query (default: False)", default=False)
parser.add_argument('-path', '--classes_path', type=str, help="path to *.names class",, default='/content/tensorflow-yolov4-tflite/data/classes/obj.names')
args = parser.parse_args()

def query_yes_no(question, default="yes", bypass=False):
Expand Down Expand Up @@ -75,7 +76,7 @@ def rename_class(current_class_name, new_class_name):
for line in new_content:
new_f.write("%s\n" % line)

with open('../../data/classes/coco.names') as f:
with open(args.classes_path) as f:
for line in f:
current_class_name = line.rstrip("\n")
new_class_name = line.replace(' ', args.delimiter).rstrip("\n")
Expand Down

0 comments on commit 836113e

Please sign in to comment.