Created
May 24, 2020 11:39
-
-
Save iavinas/7e3120bc457a1acd8002aee5f5598969 to your computer and use it in GitHub Desktop.
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 | |
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