<jupyter_start><jupyter_text>Citation-https://towardsdatascience.com/object-detection-with-10-lines-of-code-d6cb4d86f606<jupyter_code>! pip install tensorflow


! pip install --upgrade pip<jupyter_output>Requirement already up-to-date: pip in c:\users\kogentix\anaconda3\lib\site-packages (18.0)<jupyter_text>conda install numpy<jupyter_code>! pip install numpy -I
import numpy.core.multiarray
!pip install spacy
! pip install scipy

! pip install opencv-python


! pip install pillow


! pip install matplotlib


! pip install h5py


! pip install keras


! pip3 install https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl<jupyter_output>Requirement already satisfied: imageai==2.0.2 from https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl in c:\users\kogentix\anaconda3\lib\site-packages (2.0.2)<jupyter_text>Download the RetinaNet model file that will be used for object detection via this linkhttps://github.com/OlafenwaMoses/ImageAI/releases/download/1.0/resnet50_coco_best_v2.0.1.h5<jupyter_code>import os as os
os.getcwd()
os.chdir('C:\\Users\\KOGENTIX\\Desktop\\image')
os.getcwd()
from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "image.jpeg"), output_image_path=os.path.join(execution_path , "imagenew.jpeg"))

for eachObject in detections:
    print(eachObject["name"] , " : " , eachObject["percentage_probability"] )<jupyter_output>person  :  56.95698857307434
person  :  52.80917286872864
person  :  70.20386457443237
person  :  76.8346905708313
person  :  78.70020866394043
bicycle  :  79.7773540019989
person  :  83.55741500854492
person  :  89.43805694580078
truck  :  60.933083295822144
person  :  69.52632069587708
bus  :  98.00646901130676
truck  :  83.69445204734802
car  :  71.7008650302887
{'fraction_non_alphanumeric': 0.1159351145038168, 'fraction_numerical': 0.12213740458015267, 'mean_word_length': 5.335347432024169, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '219481', 'license': 'Apache-2.0', 'n_tokens_mistral': 965, 'n_tokens_neox': 808, 'n_words': 126, 'path': 'computer-vision/computer vision.ipynb', 'repo_name': 'sayanb3/python_for_datascience', 'size': '2096'}