Skip to content

Commit

Permalink
Update remove_img_by_list.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aimuch authored Aug 13, 2020
1 parent 9819dd6 commit c64637d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions remove_img_by_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import shutil
import sys
import argparse
from tqdm import tqdm


def parse_args():
Expand Down Expand Up @@ -38,18 +39,15 @@ def pick(delListTxt, imgDir):
os.makedirs(pickedImg_dir)

file_ = open(delListTxt, 'r')
delimglists = file_.readlines()
delimglists = [f.strip() for f in file_.readlines()]
file_.close()

for img in imglists:
for img in tqdm(imglists):
img = img.strip()
imgname = os.path.basename(img)
if img in delimglists:
if imgname in delimglists:
continue

print(imgname + " -->start!")
fileInfor = imgname.split(".")

src_img = os.path.join(imgDir, img)
dst_img = os.path.join(pickedImg_dir, imgname)

Expand Down

0 comments on commit c64637d

Please sign in to comment.