Skip to main content

Computer vision robotics project

Project description

Computer Vision Robot

Python Version Badge License Badge

Library for computer vision code in Google Colab and Raspberry Pi. Uses Yolo v3 with OpenCV.

Config:

Place the following files in the same directory as your script to configure.

  • CONFIG_CV_SERVER.py - runs in server mode
  • CONFIG_CV_ROBOT.py - runs in server mode on robot
  • CONFIG_CV_LIVE_IMG.py - replaces server preview with matplotlib window

By default, the code will not use cameras (great for Google Colab!)

Example:

#Imports
from CV_Robot import robot
from CV_Robot import vision
from time import sleep

#Example - find objects in an image
img = vision.load_image("sample_images/sample_005.png")
vision.show_image(img)
vision.show_objects(img, pause=True)
print(vision.find_objects(img))

#Example - drive forward until a STOP_SIGN is found
robot.forward()
vision.activate_camera()
while True:
    img = vision.get_camera_image()
    if img is None: #This is good practice - it will stop the loop if the video ends / the camera fails
        break
    vision.show_objects(img)
    if vision.Objects.STOP_SIGN in vision.find_objects(img):
        break
    sleep(0.1)
robot.stop()

Data Sources

https://github.com/nandinib1999/object-detection-yolo-opencv

#Download some sample videos + images for testing
wget https://github.com/nandinib1999/object-detection-yolo-opencv/raw/master/videos/pedestrians.mp4
wget https://github.com/nandinib1999/object-detection-yolo-opencv/raw/master/videos/car_on_road.mp4
wget -O sample_images.zip https://github.com/RobertJN64/CV_Robot/raw/master/Examples/Samples/100samples.zip
unzip sample_images.zip -d sample_images

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cv_robot-0.4.5.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

CV_Robot-0.4.5-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file cv_robot-0.4.5.tar.gz.

File metadata

  • Download URL: cv_robot-0.4.5.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for cv_robot-0.4.5.tar.gz
Algorithm Hash digest
SHA256 a502d205b1a028c6b2f9336aefdb55e4718759ba7c64158916c5b7e380748fce
MD5 e8df09067d59c59ba79a629d17d350e9
BLAKE2b-256 069d3f605256fb4282fed5342c6f19ae907df2cc07259cf24069aa7c2d4941d2

See more details on using hashes here.

File details

Details for the file CV_Robot-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: CV_Robot-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for CV_Robot-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9efd6893c38784e6ea9b17af28bde0ca548c86a5087e8f8425c01a25ae9f23a8
MD5 5b52af7b43d6528e9ba4abb4a74ca56a
BLAKE2b-256 fb04032da0e7b9744b937c72ea429dd3578539e3bb26e50190fb9eb912e012aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page