Skip to main content

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

Metadata

Release files for CV-Robot 0.4.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CV-Robot 0.4.6
File Size Uploaded Provenance
cv_robot-0.4.6.tar.gz 8.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for CV-Robot 0.4.6
File Interpreter ABI Platform
cv_robot-0.4.6-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / cv_robot-0.4.6.tar.gz

Download URL cv_robot-0.4.6.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
57578c25870adfc145a12f0942fc97f8749ee94fb67f703c2d0e285dc8c2242d
BLAKE2b-256 checksum
How to use checksums
f401ea5f452692f89301090cf3ee7ada692fcdc30f4ff34b101623742a9428b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / cv_robot-0.4.6-py3-none-any.whl

Download URL cv_robot-0.4.6-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e0f55453b158cbd154ebe6212c26a27b0e9c6f2037d3661757118ffe48f4048
BLAKE2b-256 checksum
How to use checksums
4bd2ed434786ac77cfd57cf7bd827ac52a6fff05689360c6c403e04282c5ef06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Security for CV-Robot 0.4.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.4.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page