Skip to content

A high-performance library for detecting objects in images and videos, leveraging Rust's speed and safety. Optionally supports a gRPC API for building scalable microservices, enabling seamless integration and remote inference.

License

Notifications You must be signed in to change notification settings

Supernova1744/Vision.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Logo

Vision.rs

Vision.rs is a high-performance computer vision library written in Rust. It leverages Rust’s speed and safety for efficient image processing and offers a gRPC API for building scalable microservices. This enables seamless integration and remote inference in distributed systems.

Features

  • High Performance: Utilizes Rust for safe and fast execution.
  • Scalable Microservices: gRPC API makes it easy to integrate with microservice architectures.
  • Remote Inference: Supports remote inference for flexible deployment.
  • CUDA Support: Optionally enable CUDA for hardware acceleration.

Prerequisites

  • Rust: Ensure that you have Rust installed. Visit rust-lang.org for installation instructions.
  • Protoc: Verify that the Protocol Buffer compiler (protoc.exe) is correctly configured. You may need to update the path on line 6 of build.rs if necessary.
  • CUDA (Optional): Install CUDA drivers and libraries if you plan to run with GPU support.

Running the Application

To run Vision.rs using the provided YOLOv8n ONNX model and an input image, execute the following command:

$ cargo run --release -- --model assets/weights/yolov8n.onnx

To enable CUDA support, append the --cuda flag along with the device ID:

$ cargo run --release -- --model assets/weights/yolov8n.onnx --cuda --device_id <id>

Generating Python gRPC Scripts

To generate Python encoding/decoding scripts for gRPC communication, run:

$ python -m grpc_tools.protoc -I./proto --python_out=. --grpc_python_out=. ./proto/result.proto

This command creates the necessary Python files based on your gRPC .proto definitions.

Note: To utilize CUDA acceleration in this repository, ensure that your system has CUDA 12.x and cuDNN 9.x installed. Compatibility between CUDA and cuDNN versions is crucial for optimal performance. For detailed compatibility information, refer to NVIDIA's support matrix.

Testing

for API testing you can use the python scripts under tests dir

You need to run the following command to generate

$ pip install grpcio-tools opencv-python

$ python -m grpc_tools.protoc -I . --proto_path=proto\result.proto --python_out=tests --grpc_python_out=tests proto\result.proto

$ python tests\video_client.py VIDEO_PATH
(or)
$ python tests\image_client.py IMAGE_PATH

Contributing

Contributions are welcome! If you have any suggestions or improvements, please open an issue or submit a pull request.

About

A high-performance library for detecting objects in images and videos, leveraging Rust's speed and safety. Optionally supports a gRPC API for building scalable microservices, enabling seamless integration and remote inference.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published