improve codes comments
This commit is contained in:
@@ -11,6 +11,7 @@ def main(args):
|
||||
for img_path in img_paths:
|
||||
status = True
|
||||
if args.check:
|
||||
# read the image once for check, as some images may have errors
|
||||
try:
|
||||
img = cv2.imread(img_path)
|
||||
except Exception as error:
|
||||
@@ -20,6 +21,7 @@ def main(args):
|
||||
status = False
|
||||
print(f'Img is None: {img_path}')
|
||||
if status:
|
||||
# get the relative path
|
||||
img_name = os.path.relpath(img_path, root)
|
||||
print(img_name)
|
||||
txt_file.write(f'{img_name}\n')
|
||||
|
||||
Reference in New Issue
Block a user