Created
October 25, 2019 14:42
-
-
Save philschmid/691183997945327b987d74f37c0ad5e7 to your computer and use it in GitHub Desktop.
Tensorflow 1.X object detection https://github.com/TannerGilbert/Tutorials/blob/master/Tensorflow%20Object%20Detection/object_detection_with_own_model.ipynb
This file contains hidden or 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
from PIL import Image | |
import os | |
import argparse | |
def rescale_images(directory, size): | |
for img in os.listdir(directory): | |
im = Image.open(directory+img) | |
im_resized = im.resize(size, Image.ANTIALIAS) | |
im_resized.save(directory+img)if __name__ == '__main__': | |
This file contains hidden or 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
def main(): | |
for folder in ['train', 'test']: | |
image_path = os.path.join(os.getcwd(), ('images/' + folder)) | |
xml_df = xml_to_csv(image_path) | |
xml_df.to_csv(('images/'+folder+'_labels.csv'), index=None) | |
print('Successfully converted xml to csv.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment