Just notice this
news about ImageAI today. So, I just had it tested for fun. I
seriously don't want to talk about ImageAI too much,
you can follow the author's github and
it shouldn't be that hard to have everything done in minutes.
1. Preparation
1.1 Prerequisite Dependencies
As described by on ImageAI's Github,
multiple Python dependencies need to be installed:
Tensorflow
Numpy
SciPy
OpenCV
Pillow
Matplotlib
h5py
Keras
All packages can be easily installed by command:
1
pip3 install PackageName
Afterwards, ImageAI can be
installed by a single command:
$ python FirstPrediction.py 2018-07-02 18:12:09.275412: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA convertible : 52.45954394340515 sports_car : 37.61279881000519 pickup : 3.1751133501529694 car_wheel : 1.817503571510315 minivan : 1.748703233897686
$ python FirstDetection.py Using TensorFlow backend. 2018-07-02 18:23:09.634037: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-07-02 18:23:11.744790: W tensorflow/core/framework/allocator.cc:101] Allocation of 68300800 exceeds 10% of system memory. 2018-07-02 18:23:11.958081: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:12.174739: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:12.433540: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:12.694631: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:16.267111: W tensorflow/core/framework/allocator.cc:101] Allocation of 64224000 exceeds 10% of system memory. 2018-07-02 18:23:16.370939: W tensorflow/core/framework/allocator.cc:101] Allocation of 64224000 exceeds 10% of system memory. 2018-07-02 18:23:16.403353: W tensorflow/core/framework/allocator.cc:101] Allocation of 67435200 exceeds 10% of system memory. person : 55.596935749053955 person : 66.90954566001892 person : 67.96322464942932 person : 50.80411434173584 bicycle : 64.87574577331543 bicycle : 72.0929205417633 person : 80.02063035964966 person : 85.82872748374939 truck : 59.56767797470093 person : 66.69963002204895 person : 79.37889695167542 person : 64.81361389160156 bus : 65.35580158233643 bus : 97.16107249259949 bus : 68.20474863052368 truck : 67.65954494476318 truck : 77.73774266242981 bus : 69.96590495109558 truck : 69.54039335250854 car : 61.26518249511719 car : 59.965676069259644
And, under the program folder, you will get an output image:
$ python FirstDetection.py Using TensorFlow backend. 2018-07-02 18:25:24.919351: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA person : 53.27633619308472 person : 52.71329879760742 person : 63.67729902267456 person : 55.00321388244629 person : 74.53054189682007 person : 51.54905915260315 motorcycle : 59.057921171188354 bus : 93.79504919052124 bus : 86.21828556060791 bus : 77.143394947052 person : 59.69809293746948 car : 71.79147601127625 car : 60.15858054161072 person : 62.758803367614746 person : 58.786213397979736 person : 76.49624943733215 car : 56.977421045303345 person : 67.86248683929443 person : 50.977784395217896 person : 52.3215651512146 motorcycle : 52.81376242637634 person : 76.79281234741211 motorcycle : 74.65972304344177 person : 55.96961975097656 person : 68.15704107284546 motorcycle : 56.21282458305359 bicycle : 71.78951501846313 motorcycle : 69.68616843223572 bicycle : 91.09067916870117 motorcycle : 83.16765427589417 motorcycle : 61.57424449920654
And, under the program folder, you will get an output image: