Last active
March 28, 2021 11:32
-
-
Save aliyevorkhan/7f0dfff643c9a7fe9f037e570cdb04ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import sys | |
import os | |
lbls = [] | |
frames = [] | |
if_lbl_exists = False | |
for lbl in glob.glob(str(sys.argv[1])+'/*.txt'): | |
lbls.append(lbl.split('/')[1].split('.')[0]) | |
for frame in glob.glob(str(sys.argv[2])+'/*.jpg'): | |
frames.append(frame.split('/')[1].split('.')[0]) | |
for f in frames: | |
for l in lbls: | |
if f==l: | |
if_lbl_exists=True | |
if not if_lbl_exists: | |
print(f) | |
os.remove(str(sys.argv[2])+'/'+str(f)+'.jpg') | |
if_lbl_exists=False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it can usable for yolo format label cleaning