Skip to content

vreconio/vrecon-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VRecon JavaScript SDK

JavaScript/Node.js client library for the VRecon Vehicle Recognition Intelligence Platform.

Installation

npm install @vrecon/client

Or install from source:

git clone https://github.com/vrecon-io/vrecon-js.git
cd vrecon-js
npm install
npm link

Quick Start

As a Library

import { VReconApiClient } from '@vrecon/client';

// Initialize the client
const client = new VReconApiClient('your_api_key');

// Submit an image for recognition
const response = await client.recognize('path/to/vehicle.jpg');
console.log(`Request UUID: ${response.requestUuid}`);

// Check the status
const state = await client.getState(response.requestUuid);
console.log(`State: ${state.state}`);

// Or submit and wait for the result
const result = await client.recognizeAndWait('path/to/vehicle.jpg');
if (result.result) {
    console.log(`Vehicle: ${result.result.make} ${result.result.model}`);
}

Command Line Interface

# Submit an image for recognition
vrecon -k your_api_key recognize image.jpg

# Check the status of a request
vrecon -k your_api_key state <request_uuid>

# Submit and wait for the result
vrecon -k your_api_key recognize-wait image.jpg

# With verbose output
vrecon -k your_api_key -v recognize-wait image.jpg

# Custom base URL
vrecon -k your_api_key --url https://custom.vrecon.io recognize image.jpg

API Reference

VReconApiClient

The main client class for interacting with the VRecon API.

Constructor

new VReconApiClient(apiKey, baseUrl = 'https://vrecon.io', verbose = false)

Methods

  • recognize(imagePath) - Submit an image for recognition. Returns Promise<RecognizeResponse>
  • getState(requestUuid) - Check the status of a request. Returns Promise<StateResponse>
  • recognizeAndWait(imagePath, pollIntervalMs = 2000, maxWaitMs = 60000) - Submit and wait for completion. Returns Promise<StateResponse>

Data Types

RecognitionResult

Contains the vehicle recognition results:

  • vehicle_found: boolean - Whether a vehicle was detected
  • make: string|null - Vehicle manufacturer
  • model: string|null - Vehicle model
  • generation: string|null - Vehicle generation/year range
  • color: string|null - Vehicle color
  • side: string|null - Which side of the vehicle is visible
  • angle: string|null - Camera angle
  • recognition_probability: number|null - Confidence score (0.0 to 1.0)
  • rect_area: RectArea|null - Bounding box of the vehicle
  • damage_detected: boolean - Whether damage was detected
  • damage_area: RectArea[] - Bounding boxes of damaged areas
  • detection_notes: string|null - Additional notes
  • multiple_vehicles_in_image: boolean - Whether multiple vehicles were found

Requirements

  • Node.js 18.0.0 or higher

License

MIT License - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published