Skip to content

Instantly share code, notes, and snippets.

@iavinas
Created May 24, 2020 11:39
Show Gist options
  • Save iavinas/7e3120bc457a1acd8002aee5f5598969 to your computer and use it in GitHub Desktop.
Save iavinas/7e3120bc457a1acd8002aee5f5598969 to your computer and use it in GitHub Desktop.
from PIL import Image
def run_app(img_path):
img = Image.open(img_path)
plt.imshow(img)
plt.show()
if dog_detector(img_path):
print('Dog detected, Breed is ', end=' ')
breed = Resnet50_predict_breed(img_path)
print(breed)
elif face_detector(img_path):
print('Human detected\n Looks like: ', end=' ')
breed = Resnet50_predict_breed(img_path)
print(breed)
else:
print('Not a dog or human')
import os
files = os.listdir('upload_img/')
file.remove('.ipynb_checkpoints')
for file in files:
run_app('upload_img/'+ file)
run_app('upload_img/'+ file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment