Skip to main content

No project description provided

Project description

smretrofit

smretrofit is a Python library designed to process video and image data using machine learning models hosted on the Somikoron API. This library provides functionalities to analyze videos and images, detecting defects and generating ratings based on various criteria.

You can find the source code and documentation for smretrofit on GitHub.

For reporting issues or feature requests, please visit the issues page.

Features

  • Video Processing: Analyze video files frame-by-frame, extract random samples, and save processed frames.
  • Image Processing: Send image files to the Somikoron API for defect detection and rating.
  • Flexible Modes: Choose between different modes (all, defect, rating) for tailored outputs.
  • Customizable Parameters: Adjust font size, thickness, and line spacing for visual annotations.

Installation

You can install the required packages using pip:

pip install opencv-python requests Pillow numpy cryptography

Usage

Initializing the Retrofit Class

To use the SMRetrofit library, you first need to initialize the Retrofit class:

from smretrofit import Retrofit

# Initialize the Retrofit object
retrofit = Retrofit(auth_key="YOUR_AUTH_KEY", auth_pass="YOUR_AUTH_PASS")

Analyzing a Few Video Frame

To analyze a video and save the output frames:

result_data = retrofit.get_video_data_sample("path/to/video.mp4", save=True)

Analyzing Full Video

To analyze a video and save the output frames:

result_data = retrofit.get_video_data("path/to/video.mp4", save=True)

Analyzing an Image

To analyze an image:

results = retrofit.get_image_data("path/to/image.jpg", save=True)

Parameters

  • url: API endpoint for Somikoron. Default is "https://api.somikoron.ai/api/".
  • auth_key: Your authentication key for the API.
  • auth_pass: Your authentication password for the API.
  • font_size: Size of the font for labels (default: 7).
  • font_thickness: Thickness of the font for labels (default: 3).
  • line_space: Space between lines of labels (default: 10).
  • detect_mode: Detect Mode of operation (all, defect, rating).
  • label_mode: Label Mode of operation (all, defect, rating).

Example

Here’s a simple example demonstrating how to use the library:

from smretrofit import Retrofit

# Create an instance of the Retrofit class
retrofit = Retrofit(auth_key="YOUR_AUTH_KEY", auth_pass="YOUR_AUTH_PASS")

# Process a video
result_data = retrofit.get_video_data("path/to/video.mp4", save=True)

# Process an image
results = retrofit.get_image_data("path/to/image.jpg", save=True)

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

smretrofit-1.0.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smretrofit-1.0.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file smretrofit-1.0.3.tar.gz.

File metadata

  • Download URL: smretrofit-1.0.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for smretrofit-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c958d5c15d921aae94bbd03fe7734e4004eb07f02261b1da7a6152f8d6a1c49e
MD5 d1d55efc77670f88554fdf4914d0ce2e
BLAKE2b-256 42298d529844cf492f185a5b8900155a868926c051da60e16bd94af1e9382a35

See more details on using hashes here.

File details

Details for the file smretrofit-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: smretrofit-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for smretrofit-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 83df19a4dc37120b19eebf41b2fd993d45cf71ebd28849a4ee6cead2c5644419
MD5 23288306984e8bfbaf5a670ce093140f
BLAKE2b-256 9263e327bfd20530e5b82d93c783607cc67a66afa3b5fdf462f53c0106dec103

See more details on using hashes here.

Supported by

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