VISIONRESEARCH

Code Samples

Explore code examples demonstrating how to integrate Vision Research APIs into your projects.

Getting Started

Node.js SDK

    const VisionResearch = require('@visionresearch-sdk/core');
    
    const client = new VisionResearch.Client({
      apiKey: 'YOUR_API_KEY',
    });
    
    client.analyzeImage('image.jpg')
      .then(response => console.log(response))
      .catch(error => console.error(error));

Python SDK

    from visionresearch import VisionAPIClient
    
    client = VisionAPIClient(api_key="YOUR_API_KEY")
    
    with open("image.jpg", "rb") as image_file:
        result = client.analyze(image=image_file)
        print(result)

REST API

curl Example

curl -X POST \
  https://api.visionresearch.com/v1/vision/analyze \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'image=@/path/to/image.jpg'

Response Example

{
  "analysis_id": "abc123",
  "objects": [
    {
      "label": "car",
      "confidence": 0.92,
      "bounding_box": [120, 150, 300, 200]
    }
  ]
}

Advanced Features

Async Processing

// Submit task
const jobId = await client.submitLongRunningTask(...);

// Get status later
const result = await client.getJobResult(jobId);

Custom Model Training

client.trainCustomModel({
  dataset: 'custom-dataset.zip',
  modelType: 'object_detection',
  parameters: { epochs: 10 }
}).then(result => console.log(result));