sábado, 10 de novembro de 2018

Object_Prediction_and_Detecting-Image

Object_Prediction_and_Detecting-Image

Another example using Tensorflow to detect objects in an image.

As described by on ImageAI’s Github, multiple Python dependencies need to be installed:

Tensorflow 
Numpy 
SciPy 
OpenCV 
Pillow 
Matplotlib 
h5py 
Keras
Two CNN models are adopted as in the examples prediction and detection.
a) Prediction : resnet50_weights_tf_dim_ordering_tf_kernels.h5 - can be downloaded at fchollet’s deep-learning-models

b) Detection: resnet50_coco_best_v2.1.0.h5 - can be downloaded at fizyr’s keras-retinanet

ImageAI provides 4 different algorithms and model types to perform image prediction. To perform image prediction on any picture, take the following simple steps. The 4 algorithms provided for image prediction include SqueezeNet, ResNet, InceptionV3 and DenseNet. Each of these algorithms have individual model files which you must use depending on the choice of your algorithm. Some algorithms:

1. SqueezeNet (Size = 4.82 mb, fastest prediction time and moderate accuracy) 
2. ResNet50 by Microsoft Research (Size = 98 mb, fast prediction time and high accuracy) 
3. InceptionV3 by Google Brain team (Size = 91.6 mb, slow prediction time and higher accuracy) 
4. DenseNet121 by Facebook AI Research (Size = 31.6 mb, slower prediction time and highest accuracy) Image to Predict: 

Lets go to detection this image:


And the result is that:


See the code program on my Github:

Sem comentários:

Enviar um comentário