OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.55k stars 2.19k forks source link

Exception during execution in batch recognition of cars #114

Closed jorgediaz87 closed 5 years ago

jorgediaz87 commented 5 years ago

Python: 3.6.7 Tensorflow: 1.12.0

Hello, first of all I would like to thank you for the work dedicated to this fantastic library and give you all my support to continue working on it.

I created an API server to send the images and process them in batches, and from time to time these exceptions occur to which I can't find an explanation. I'm using the model: resnet50_coco_best_v2.0.1.h5

2018-11-28 07:25:23.867 : ERROR : Hoot-API_Image : Error 500: Internal error

Args:
{'Advertiser ID': 777,
'Image URL': 'https://inventory-cf.assets-cdk.com/9/9/4/18283751499.jpg',
'Make': 'Chevrolet'}
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/imageai/Detection/__init__.py", line 683, in detectCustomObjectsFromImage
if (custom_objects[check_name] == "invalid"):
KeyError: 'hair drier'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/hoot/backend/hoot/ml/api.py", line 212, in get_info
image_boxes, image_crop = hoot.ml.image.detection.crop(model, model_objects, image_pil)
File "/home/hoot/backend/hoot/ml/image/detection.py", line 68, in crop
minimum_percentage_probability=35
File "/usr/local/lib/python3.6/dist-packages/imageai/Detection/__init__.py", line 860, in detectCustomObjectsFromImage
"Ensure you specified correct input image, input type, output type and/or output image path ")
ValueError: Ensure you specified correct input image, input type, output type and/or output image path
OlafenwaMoses commented 5 years ago

Error noted. It is a bug in line 79 and 939 of the imageai/Detection/init.py. All you need to do is to access the file and replace the "drier" with the word "dryer".

naihe2010 commented 5 years ago

can pull this: https://github.com/OlafenwaMoses/ImageAI/pull/69