Python code in notebook below:
**from keras.applications.resnet50 import preprocess_input, decode_predictions
def ResNet50_predict_labels(img_path):
img = preprocess_input(path_to_tensor(img_path))
return np.argmax(ResNet50_model.predict(img))
def dog_detector(img_path):
prediction = ResNet50_predict_labels(img_path)
return ((prediction <= 268) & (prediction >= 151))**
dog_pic_sum_from_human_files = np.sum([1 if dog_detector(img_path1) \
else 0 for img_path1 in list(human_files_short)])
dog_pic_sum = np.sum([1 if dog_detector(img_path2) \
else 0 for img_path2 in list(dog_files_short)])**
Windows error log below:
error app: python.exe,version: 3.5.3150.1013,timestamp: 0x58ae5709
module ucrtbase.dll version: 10.0.15063.413,timestamp: 0x5ba8b66e
Exception code: 0xc0000409
offset: 0x00000000000734be
PID: 0x4c4
App path: D:\softinstalled\task\anaconda3\envs\dog-project\python.exe
Module path: C:\Windows\System32\ucrtbase.dll
Report ID: 93719113-f242-4e45-948d-9df8437fe2ac
User contributions licensed under CC BY-SA 3.0