Created
May 16, 2019 14:32
-
-
Save xu-chris/64fb96dbcecd439a255c3a48b7c53e3a 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 os | |
import glob | |
def get_image_paths(path): | |
# Gather image paths | |
image_paths = glob.iglob(os.path.join(path, "*.png")) | |
# Loop through images, skip those without bounding boxes | |
for image_path in image_paths: | |
print(image_path) | |
path, file_extension = os.path.splitext(image_path) | |
bounding_box_file = path + ".txt" | |
# Skip data without bounding boxes | |
if not os.path.isfile(bounding_box_file): | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment