QJ Python SDK
Project description
py-qj-robots
QJ Robots Python SDK provides powerful machine vision perception capabilities, supporting object detection, image segmentation, attribute description, angle prediction, keypoint detection, and grasp point prediction for 2D/3D images.
Requirements
- Python 3.x
- Dependencies: requests>=2.26.0, python-dotenv>=0.19.0
Installation
pip install py-qj-robots
Configuration
The following environment variables need to be configured before using the SDK:
- QJ_APP_ID: Application ID
- QJ_APP_SECRET: Application Secret
You can click here to obtain your Application ID and Secret.
You can configure these variables in two ways:
- Create a .env file:
QJ_APP_ID=your_app_id
QJ_APP_SECRET=your_app_secret
- Using export command:
export QJ_APP_ID=your_app_id
export QJ_APP_SECRET=your_app_secret
Quick Start
from dotenv import load_dotenv
from py_qj_robots import Perception
import os
# Load environment variables
load_dotenv()
# Initialize Perception instance
perception = Perception()
# Perform 2D image detection
result = perception.check_image(
image_type="2D",
image_url="http://example.com/image.jpg",
object_names=["bottle", "cup"]
)
print(f"Detection result: {result}")
API Documentation
Perception Class
check_image
Detect target objects in the image.
def check_image(image_type: str, image_url: str, object_names: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
Parameters:
- image_type: Image type, '2D' or '3D'
- image_url: Image URL
- object_names: Names of objects to detect, can be a string or list of strings
- depth_url: Depth image URL (required only when image_type is '3D')
split_image
Segment target objects in the image.
def split_image(image_type: str, image_url: str, object_names: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
Return value includes:
- boxes: Bounding box coordinates [x1,y1,x2,y2]
- masks: Mask image URLs and data
- croppedImagesListBbox: Cropped image URLs
- labels: Detected object labels
- scores: Confidence scores
props_describe
Get attribute descriptions of objects in the image.
def props_describe(image_type: str, image_url: str, object_names: Union[str, List[str]], questions: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
angle_prediction
Predict object angles.
def angle_prediction(image_type: str, image_url: str, object_names: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
key_point_prediction
Predict object keypoints.
def key_point_prediction(image_type: str, image_url: str, object_names: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
grab_point_prediction
Predict object grasp points.
def grab_point_prediction(image_type: str, image_url: str, object_names: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
full_perception
Perform complete perception analysis, including all features.
def full_perception(image_type: str, image_url: str, object_names: Union[str, List[str]], questions: Union[str, List[str]], depth_url: Optional[str] = None) -> Dict
Return value includes all perception results:
- angles: Angle information
- boxes: Bounding boxes
- masks: Segmentation masks
- points: Keypoints
- grasps: Grasp points
- answers: Attribute descriptions
- etc.
More Information
Visit QJ Robots Official Website for more information.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_qj_robots-0.1.9.tar.gz.
File metadata
- Download URL: py_qj_robots-0.1.9.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8edbec430016613001e1dd0fff0fd70a26f8a49fffa362e73dead4589dc67ab8
|
|
| MD5 |
ff84b02d484559fed3d94ba10948d792
|
|
| BLAKE2b-256 |
a5dffb1e626c280ffb031f252dc7690c8464483a6e7cdc8656a778d5c6f3fc37
|
File details
Details for the file py_qj_robots-0.1.9-py3-none-any.whl.
File metadata
- Download URL: py_qj_robots-0.1.9-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3757564f3bb23cc325e46c6b41fff866a22861681682ace46e3e5bf4353c2e81
|
|
| MD5 |
0b82538b333dc3e2368bb74a5c101655
|
|
| BLAKE2b-256 |
dab0143f457d1cac9d8548384a4d8294eba31e2bc697923baf6aac0570ec6dc0
|