สอน Python OpenCV - ตรวจจับวัตถุในภาพด้วย Image AI HD

16.04.2019
python -m pip install --upgrade pip ---------------------------------- Step 1 Install Module: --------------------------------- pip install tensorflow pip install numpy pip install scipy pip install opencv-python pip install pillow pip install matplotlib pip install h5py pip install keras ---------------------------------- Step 2 Download : https://github.com/OlafenwaMoses/ImageAI/releases/download/1.0/resnet50_coco_best_v2.0.1.h5 ---------------------------------- Step 3 : pip install https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl ---------------------------------- Step 4 Paste Code : 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.jpg"), output_image_path=os.path.join(execution_path , "imagenew.jpg")) for eachObject in detections: print(eachObject["name"] , " : " , eachObject["percentage_probability"] ) ---------------------------------- How to : https://arxiv.org/pdf/1708.02002.pdf

Похожие видео