Techsolut SDK Documentation
Easily integrate Techsolut's capabilities into your applications with our official SDKs available for multiple programming languages.
Version 2.5.0 Last updated: April 15, 2025
Overview
Techsolut SDKs provide a straightforward way to access our computer vision API with syntax that's native to your preferred programming language. Our SDKs support object detection, image classification, OCR, and other advanced features.
Easy Integration
Simple installation with standard package managers like pip, npm, and composer.
Complete API
Access all Techsolut API features with comprehensive documentation.
Robust Error Handling
Detailed error messages and specific exceptions for easy debugging.
Installation
pip install techsolut-sdk
Install the package
Use pip to install the Techsolut SDK
Import the SDK
import techsolut as ts
Configure your API key
client = ts.Client("your_api_key_here")
npm install @techsolut/sdk
Install the package
Use npm or yarn to install the Techsolut SDK
Import the SDK
// CommonJS
const Techsolut = require('@techsolut/sdk');
// ES Modules
import Techsolut from '@techsolut/sdk';
Configure your API key
const client = new Techsolut.Client("your_api_key_here");
composer require techsolut/sdk
Install the package
Use Composer to install the Techsolut SDK
Import the SDK
require_once 'vendor/autoload.php';
use Techsolut\SDK\Client;
Configure your API key
$client = new Client("your_api_key_here");
<dependency>
<groupId>fr.techsolut</groupId>
<artifactId>techsolut-sdk</artifactId>
<version>2.5.0</version>
</dependency>
Install the package
Add the Maven or Gradle dependency to your project
Import the SDK
import fr.techsolut.sdk.Client;
import fr.techsolut.sdk.models.*;
Configure your API key
Client client = new Client("your_api_key_here");
Usage Examples
Object Detection
import techsolut as ts
# Initialize the client
client = ts.Client("your_api_key_here")
# Detect objects in an image
result = client.detect_objects(
image_url="https://example.com/image.jpg",
confidence=0.5,
model="yolov8x" # Optional, defaults to the latest model
)
# Process the results
for detection in result.detections:
print(f"Found {detection.class_name} with {detection.confidence:.2f} confidence")
box = detection.box
print(f"Position: ({box.x1}, {box.y1}) to ({box.x2}, {box.y2})")
// Import the SDK
import Techsolut from '@techsolut/sdk';
// Initialize the client
const client = new Techsolut.Client("your_api_key_here");
// Detect objects in an image
async function detectObjects() {
try {
const result = await client.detectObjects({
imageUrl: "https://example.com/image.jpg",
confidence: 0.5,
model: "yolov8x" // Optional, defaults to the latest model
});
// Process the results
result.detections.forEach(detection => {
console.log(`Found ${detection.className} with ${detection.confidence.toFixed(2)} confidence`);
const box = detection.box;
console.log(`Position: (${box.x1}, ${box.y1}) to (${box.x2}, ${box.y2})`);
});
} catch (error) {
console.error("Detection failed:", error.message);
}
}
detectObjects();
// Import the SDK
require_once 'vendor/autoload.php';
use Techsolut\SDK\Client;
// Initialize the client
$client = new Client("your_api_key_here");
// Detect objects in an image
try {
$result = $client->detectObjects([
'image_url' => 'https://example.com/image.jpg',
'confidence' => 0.5,
'model' => 'yolov8x' // Optional, defaults to the latest model
]);
// Process the results
foreach ($result->getDetections() as $detection) {
echo "Found " . $detection->getClassName() . " with " .
round($detection->getConfidence(), 2) . " confidence\n";
$box = $detection->getBox();
echo "Position: (" . $box->getX1() . ", " . $box->getY1() . ") to (" .
$box->getX2() . ", " . $box->getY2() . ")\n";
}
} catch (Exception $e) {
echo "Detection failed: " . $e->getMessage();
}
// Import the SDK
import fr.techsolut.sdk.Client;
import fr.techsolut.sdk.models.DetectionResult;
import fr.techsolut.sdk.models.Detection;
import fr.techsolut.sdk.models.Box;
import fr.techsolut.sdk.exceptions.TechsolutException;
import java.util.Map;
import java.util.HashMap;
public class ObjectDetectionExample {
public static void main(String[] args) {
// Initialize the client
Client client = new Client("your_api_key_here");
// Prepare request parameters
Map params = new HashMap<>();
params.put("imageUrl", "https://example.com/image.jpg");
params.put("confidence", 0.5);
params.put("model", "yolov8x"); // Optional, defaults to the latest model
try {
// Detect objects in an image
DetectionResult result = client.detectObjects(params);
// Process the results
for (Detection detection : result.getDetections()) {
System.out.printf("Found %s with %.2f confidence%n",
detection.getClassName(), detection.getConfidence());
Box box = detection.getBox();
System.out.printf("Position: (%.1f, %.1f) to (%.1f, %.1f)%n",
box.getX1(), box.getY1(), box.getX2(), box.getY2());
}
} catch (TechsolutException e) {
System.err.println("Detection failed: " + e.getMessage());
}
}
}
Image Classification
import techsolut as ts
# Initialize the client
client = ts.Client("your_api_key_here")
# Classify an image
result = client.classify_image(
image_url="https://example.com/image.jpg",
top_k=5 # Return top 5 classes
)
# Process the results
for classification in result.classifications:
print(f"{classification.label}: {classification.confidence:.2f}")
// Import the SDK
import Techsolut from '@techsolut/sdk';
// Initialize the client
const client = new Techsolut.Client("your_api_key_here");
// Classify an image
async function classifyImage() {
try {
const result = await client.classifyImage({
imageUrl: "https://example.com/image.jpg",
topK: 5 // Return top 5 classes
});
// Process the results
result.classifications.forEach(classification => {
console.log(`${classification.label}: ${classification.confidence.toFixed(2)}`);
});
} catch (error) {
console.error("Classification failed:", error.message);
}
}
classifyImage();
API Reference
Detects objects in an image and returns their bounding boxes, classes, and confidence scores.
Parameters
Name | Type | Description |
---|---|---|
image_url | string | URL of the image to analyze Required if image_data is not provided |
image_data | string | Base64-encoded image data Required if image_url is not provided |
confidence | float | Minimum confidence threshold (0-1) Default: 0.25 |
model | string | Model to use for detection Default: "yolov8x" |
Returns
{
"success": true,
"detections": [
{
"box": {
"x1": 23.5,
"y1": 74.2,
"x2": 483.1,
"y2": 352.7
},
"class": "person",
"confidence": 0.92
},
...
],
"processing_time": 0.234
}
Classifies the content of an image by assigning labels and confidence scores.
Parameters
Name | Type | Description |
---|---|---|
image_url | string | URL of the image to analyze Required if image_data is not provided |
image_data | string | Base64-encoded image data Required if image_url is not provided |
top_k | int | Number of top categories to return Default: 5 |
model | string | Model to use for classification Default: "resnet101" |
Support
If you encounter any issues or have questions about our SDKs, please check out the resources below:
Contribute
Our SDKs are open source! You can view the source code, report issues, and contribute on GitHub at github.com/techsolut/sdk.