computer_science:computer_vision:opencv:object_identification_tensorflow_opencv_imageai_yolo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computer_science:computer_vision:opencv:object_identification_tensorflow_opencv_imageai_yolo [2020/08/07 13:42] carlossousacomputer_science:computer_vision:opencv:object_identification_tensorflow_opencv_imageai_yolo [2023/12/01 12:07] (current) – external edit 127.0.0.1
Line 5: Line 5:
 Be sure to have the [[:computer_science:computer_vision:opencv:object_identification_tensorflow_opencv_imageai_yolo_requirements|requirements]] installed. Be sure to have the [[:computer_science:computer_vision:opencv:object_identification_tensorflow_opencv_imageai_yolo_requirements|requirements]] installed.
  
-===== The Code: =====+===== Project Start - Importing Libraries and Testing =====
  
 ==== Initialize the libraries ==== ==== Initialize the libraries ====
Line 19: Line 19:
  
 </code> </code>
 +
 ==== Testing if OpenCV is working: ==== ==== Testing if OpenCV is working: ====
  
Line 31: Line 32:
 cv.waitKey(0) # Wait for any Key to be pressed cv.waitKey(0) # Wait for any Key to be pressed
 cv.destroyAllWindows() # Destroy (all) previous created Windows cv.destroyAllWindows() # Destroy (all) previous created Windows
 +
  
 </code> </code>
  
 +==== Preparing for the upcoming project: ====
 +
 +Now that we tested that OpenCV is working let's edit that last piece of code, change it to a function, so we can reutilize it often. The complete code until now should look like this:
 +
 +<code python>
 +import cv2 as cv
 +from imageai.Detection import ObjectDetection as od
 +
 +import numpy as np
 +import requests as req
 +import os as os
 +
 +def showImage(img):
 +    window_name = 'image'
 +    cv.imshow(window_name, img)
 +    cv.waitKey(0)
 +    cv.destroyAllWindows()
 +
 +
 +</code>
 =====   ===== =====   =====
 +
 +===== Downloading Images to train the ML =====
 +
 +Run this [[:computer_science:computer_vision:opencv:object_identification_tensorflow_opencv_imageai_yolo_download_images_script|code]] to download 2 type of images that we will be using. One being only of people and the other to download images of hats. This images will be contained on they own folder since we will be using that to train the Machine Learning.
  
 ===== External References: ===== ===== External References: =====
  • computer_science/computer_vision/opencv/object_identification_tensorflow_opencv_imageai_yolo.1596807764.txt.gz
  • Last modified: 2023/12/01 12:07
  • (external edit)