Computer Vision
Five computer-vision requests on OpenCV, YOLOv4, YuNet and SFace. Every example below is the real request and response.
Object Detection
YOLOv4 running through OpenCV's DNN module finds and labels objects across COCO's 80 categories. Each detection has a class, a confidence and a box as [x, y, width, height] in source pixels, highest confidence first. Two models: YOLOv4-tiny by default for speed, and full YOLOv4 when accuracy matters. The server also writes a copy of the image with the boxes drawn.
1{
2 "id": "req-1",
3 "type": "image_object_detection",
4 "data": {"inputFile": "/srv/photos/street.jpg", "model": "tiny"}
5} 1{
2 "id": "req-1",
3 "success": true,
4 "message": "Image object detection completed - found 2 objects",
5 "data": {
6 "outputFile": "/tmp/mediaprocessor_20260925_174527.json",
7 "result": {
8 "model": "tiny",
9 "objects": [
10 {
11 "class": "person",
12 "confidence": 0.91,
13 "bbox": [412, 180, 96, 288]
14 },
15 {
16 "class": "car",
17 "confidence": 0.84,
18 "bbox": [40, 260, 310, 170]
19 }
20 ],
21 "rendered_image_path": "/tmp/mediaprocessor_20260925_174527_objects.png"
22 }
23 }
24} Face Detection
YuNet finds each face and SFace describes it. Every face comes back with a box, a confidence, five landmarks (eyes, nose tip, mouth corners) and 128-number embedding. Embeddings are normalised, so the dot product of two is their cosine similarity: that is how one person is grouped across many photos.
1{
2 "id": "req-1",
3 "type": "image_face_detection",
4 "data": {"inputFile": "/srv/photos/street.jpg", "score_threshold": 0.8}
5} 1{
2 "id": "req-1",
3 "success": true,
4 "message": "Face detection completed - found 1 faces",
5 "data": {
6 "result": {
7 "model": "yunet-2022mar+sface-2021dec",
8 "faces": [
9 {
10 "bbox": [512.0, 140.5, 88.0, 112.0],
11 "confidence": 0.94,
12 "landmarks": [
13 [535.1, 183.2],
14 [574.8, 182.6],
15 [556.0, 206.9],
16 [538.7, 229.4],
17 [571.2, 228.8]
18 ],
19 "embedding": [0.041, -0.087, 0.112, …]
20 }
21 ]
22 }
23 }
24} Depth Estimation
A monocular depth map from a single image: Gaussian blur, Sobel X/Y gradients and their magnitude, colour-mapped with OpenCV's JET colormap. Fast and approximate, with no stereo pair or depth sensor needed.
1{
2 "id": "req-1",
3 "type": "image_depth_estimation",
4 "data": {"inputFile": "/srv/photos/street.jpg"}
5} 1{
2 "id": "req-1",
3 "success": true,
4 "message": "Depth estimation completed using monocular edge-based analysis",
5 "data": {
6 "result": {
7 "depth_image_path": "/tmp/mediaprocessor_20260925_174610_depth.png"
8 }
9 }
10} Image Segmentation
K-means clustering in LAB colour space splits the image into regions. The server writes a composite of every segment first, then one mask image per segment, so each region can be used on its own.
1{
2 "id": "req-1",
3 "type": "image_segmentation",
4 "data": {"inputFile": "/srv/photos/street.jpg"}
5} 1{
2 "id": "req-1",
3 "success": true,
4 "message": "Image segmentation completed using K-means clustering - found 2 segments",
5 "data": {
6 "result": {
7 "masks": [
8 {
9 "class": "complete_segmentation",
10 "confidence": 1.0,
11 "mask_path": "/tmp/mediaprocessor_…_segmentation.png"
12 },
13 {
14 "class": "segment_0",
15 "confidence": 0.277,
16 "mask_path": "/tmp/mediaprocessor_…_segment_0.png"
17 }
18 ]
19 }
20 }
21} Keypoint Detection
Points of interest for matching, stitching and tracking: ORB for fast corners, SIFT for blobs across scales. Each keypoint has a position, size, angle and a confidence normalised to the strongest, and the server draws them on a copy of the image.
1{
2 "id": "req-1",
3 "type": "image_keypoint_detection",
4 "data": {
5 "inputFile": "/srv/photos/street.jpg",
6 "method": "orb",
7 "max_keypoints": 500
8 }
9} 1{
2 "id": "req-1",
3 "success": true,
4 "message": "Keypoint detection completed - found 1 keypoints",
5 "data": {
6 "result": {
7 "method": "orb",
8 "keypoints": [
9 {
10 "x": 212.4,
11 "y": 88.0,
12 "confidence": 1.0,
13 "size": 31.0,
14 "angle": 97.3
15 }
16 ],
17 "rendered_image_path": "/tmp/mediaprocessor_…_keypoints.png"
18 }
19 }
20} Integrate Computer Vision Today
Send a JSON request, get structured results. No machine learning expertise required.
Read the Docs