Computer vision and the path to edge AI
Computer Vision fundamentals with 5 web-based AI training options, steps for exporting models to the edge, privacy, and a bibliography
Start with the image before the model
An image is pixel values with a size, colour channels and an encoding. OpenCV helps you learn resize, color conversion, threshold and calibration. Check the channel order and data type before feeding the model, because an image that displays correctly may still have an input format different from what the model expects
Calibration and geometry
A camera/lens may have radial and tangential distortion. Use chessboard images from several viewpoints to estimate the camera matrix and distortion coefficients, then look at the reprojection error per image. Keep the resolution and settings used; do not assume one calibration can stand in for every camera
Split the data for a genuine evaluation
Consecutive frames from a single flight are usually very similar. If they are spread across both train and test, the results may look better than use in a new scene. Split the sets by scene/flight and keep the annotation version
| Metric | Question answered |
|---|---|
| Precision = TP/(TP+FP) | Of what it reports as found, how much is correct? |
| Recall = TP/(TP+FN) | Of what actually exists, how much is detected? |
| Latency median/p95 | How long does it take typically and in the slow cases? |
| RAM/VRAM | Does the target device have enough resources? |
When a denominator is zero, the handling method must be stated in the report; do not fill in values that make the result look good. Changing the confidence threshold affects precision/recall, so comparisons must use the same dataset
F17: read Precision, Recall, F1 and IoU to fit the task
Confidence is the model's score for a prediction, not accuracy measured against the ground truth A score of 0.9 on one image therefore does not mean the model is right on 90% of all images. Score calibration and results on a held-out test set must be checked
P = TP / (TP + FP) is the proportion correct among what the system reports as found
R = TP / (TP + FN) is the proportion found among what actually exists
F1 = 2PR / (P + R) = 2TP / (2TP + FP + FN)
IoU = intersection area / union area
| Variable | Meaning and units | Range and source of values |
|---|---|---|
| TP | Correct positive predictions, units per task | Integer ≥ 0 from labels and evaluator output |
| FP | Extra or wrong positive reports, units per task | Integer ≥ 0; for detection, includes duplicate boxes that cannot be matched |
| FN | Missed real objects, units per task | Integer ≥ 0 from ground truths that cannot be matched |
| P, R, F1 | Proportion, dimensionless | 0–1 when the denominator is defined |
| Intersection/union area | Box or mask area | Same units, e.g. pixel²; union > 0 |
| IoU, threshold | Proportion, dimensionless | 0–1; keep the confidence and IoU cut-offs separate |
Classification counts answers per image or per sample according to the declared classes; semantic segmentation counts per pixel and uses mask IoU; object detection must match predicted boxes to ground truth of the same class, one-to-one, that pass the IoU threshold before counting TP/FP/FN. Also state the matching order and how ignore/crowd are handled by the evaluator. Two predicted boxes over one object are not two TPs, and instance segmentation must match each instance by its own mask
This example has already fixed the parcel class and the confidence threshold. After the evaluator matches, TP = 8, FP = 2, FN = 4, so P = 8/(8+2) = 0.8, R = 8/(8+4) = 2/3 ≈ 0.6667 and F1 = 16/(16+2+4) = 8/11 ≈ 0.7273 All are dimensionless; multiply by 100 to show them as percentages
An IoU example separate from the counts above: boxes A and B each have an area of 100 pixel² with an overlap of 60 pixel², so the union = 100+100−60 = 140 pixel² and IoU = 60/140 = 3/7 ≈ 0.4286 If the IoU threshold is set to 0.5, this pair of boxes does not yet pass, even with high confidence
AP and mAP must be evaluated over several thresholds
AP summarises the precision–recall relationship from ranked scores and the changing cut-off points according to the evaluator's method, while mAP averages AP over the specified classes and IoU set; it is not (P+R)/2 . mAP50 uses IoU 0.50, while mAP50–95 covers IoU 0.50 to 0.95 in steps of 0.05, so they cannot be compared without naming the metric. In a hypothetical example where the AP of two classes under the same evaluator/IoU is 0.6 and 0.8, mAP = (0.6+0.8)/2 = 0.7, but both APs cannot be derived from TP/FP/FN at a single threshold
When a denominator is zero, this exercise reports undefined (N/A) together with the actual counts. If you must use an evaluator that substitutes 0 or excludes that class, disclose the policy and the micro/macro/weighted averaging, and do not mix results from different policies. Having no predictions but real objects present makes precision undefined, recall = 0 and F1 from the count formula = 0; this is not treated as a complete score
Definitions of P/R/F1 and averaging follow scikit-learn Model Evaluation (S16); detection AP/mAP follows Ultralytics YOLO Performance Metrics (S17) , checked 26 September B.E. 2569 (2026). When experimenting for real, record the library/evaluator version, annotation, matching, IoU, confidence and classes included in the results. The numbers in this lesson are synthetic problems
Exercise and answer
Keep TP = 8 and FN = 4 but reduce FP to 0. How do P/R/F1 change?
F17 answer
P = 8/8 = 1, R = 8/12 = 2/3 and F1 = 16/(16+0+4) = 0.8, so precision improves but 4 real objects are still missed. Rounding tolerance ±0.0001 for proportions; do not use average confidence in place of the answer
Use the existing training tools and read dataset splitting and latency measurement alongside
Try training with real drone images

This small training set uses 8 UAVVaste images for training and 4 for evaluation, split by batch name, with hashes of images and labels checked. The actual results confirm that the program updates weights, saves checkpoints and exports ONNX, but the Precision, Recall and mAP reported by the evaluator are still 0 , so it cannot yet be used for detection on a drone. The batch split does not yet confirm different areas or flights
Start from the training and result-reading guide , then check the actual results and settings against the steps on the project page . The ONNX comparison also checks values before box filtering, so it does not rely merely on both models failing to detect any object
Source images from UAVVaste by the PUTvision research team are licensed CC BY 4.0 per the dataset listing. The website's download kit keeps the commands and evidence but does not include images or weights. Learners must check the rights for data, code and models separately before building on them
What to check when the score is zero after training

A new comparison was run on 29 September B.E. 2569 (2026), starting from the same weights with the same images and settings, and changing the training budget from 3 to 30 epochs. Both runs passed the hash and label checks for all 12 images, 54 boxes in total. Increasing the number of epochs also changes the length of the learning rate schedule, so it is not simply continuing training with a constant learning rate
| Result checked | 3 epochs | 30 epochs |
|---|---|---|
| mAP50 on the 8 training images | 0 | 0.01335 |
| mAP50 on the 4 evaluation images | 0 | 0.00456 |
| Number of boxes passing confidence 0.25 across all 12 images | 0 | 0 |
mAP in the table ranges from 0–1 and is computed by the framework's evaluator, while the box count uses the separately set cut-off of 0.25. An mAP slightly above zero does not mean the model is ready for use . This evaluation set has already been used to analyse the problem, so it is not an independent test set
After resizing images to 320 pixels, 16 of the 33 objects in the evaluation set have a short side below 4 pixels. Passing the label format check therefore does not answer whether the images have enough detail. This round stopped at the planned comparison without adjusting the threshold to make the results look better, so image resolution is set as a separate problem below
Read the analysis and reproduction guide together with the 3-epoch results and 30-epoch results before experimenting further. References: detection data format and Ultralytics training settings
Does increasing resolution to 640 pixels lead to detections?

On 30 September B.E. 2569 (2026) another experiment was run with the same 8 training and 4 evaluation images, the same initial weights and the same 30-epoch training settings, but the training image size was increased from 320 to 640 pixels, and the resulting checkpoint was evaluated at both sizes. Still no box passed confidence 0.25 in either the training or evaluation images, so this model still cannot be used for detection on a drone
| Results from the checkpoint trained at 640 pixels | Evaluated at 320 | Evaluated at 640 |
|---|---|---|
| Objects in the evaluation images with a short side below 4 pixels | 16/33 | 6/33 |
| mAP50 of the evaluation images (the evaluator uses a default score of 0.001) | 0.001381 | 0 |
| Boxes passing confidence 0.25 in the 4 evaluation images | 0 | 0 |
A larger image size helps preserve the number of pixels per object, but it does not guarantee that detection scores will rise enough . The highest raw box score in the evaluation images at 640 was only 0.01409. A raw box overlapping a real object's position is still not a detection when its score is below 0.25, and the mAP the evaluator computes with a lower score threshold answers a different question from the number of boxes actually used. The small mAP of the evaluation images at 320 is therefore not evidence that the model is ready for use
This evaluation image set has already been used to analyse the problem and is not yet an independent test set; the old checkpoint trained at 320 was not kept, so we can compare the two evaluation sizes of the same new checkpoint , but we cannot draw a fully paired comparison of models trained at two sizes. The next step should be to collect more labelled images from different scenes or flights, and to plan a tiling test that defines how objects at tile edges are counted and measures false positives before experimenting
Download the per-image results and settings JSON, per-epoch plot data CSV, training and evaluation scripts and time- and resource-limited launcher . Read together with UAVVaste provenance, Ultralytics training guide and evaluation guide . The download kit contains no original images or model weights
From PC to a real board
Start inference on CPU with OpenCV/PyTorch/ONNX Runtime, then try GPU. Picamera2 requires a Raspberry Pi and a supported camera stack; jetson-inference is used with a matching Jetson/JetPack. Speed on a desktop is not a benchmark for the board
Rights to code, models and data
Separate the licences of libraries, model weights, datasets and cloud services. Ultralytics has AGPL/Enterprise; Roboflow Public makes data/models public; Colab has quotas that do not guarantee a GPU. Check the scope before choosing a tool for personal data
Web platforms for training AI for object detection on drones
Provider information checked on 7 September B.E. 2569 (2026) . This section refers to detecting objects in camera images, such as parcels, life rings or survey equipment. A detection result is not a command for the drone to fly towards, grab or follow the object automatically
Choose Object detection when you need to know “what objects are there and where”, whereas Image classification answers the category of the image as a whole, so it cannot replace location boxes for multiple objects. The file to deploy is the trained model, with its class list and image preprocessing settings , not a copy of the training image folder on the drone
Choose a tool that fits the task
| Official website | Suitable for | Path to the drone / limitations |
|---|---|---|
| Edge Impulse Studio | Getting started with object detection and preparing for use on edge devices | Choose the deployment to suit the board, such as a C++ library or Linux .eim; FOMO gives centre points, not object box sizes [1–3] |
| Ultralytics Platform | Drawing boxes, training YOLO and exporting the model | Offers ONNX, TensorRT and other formats depending on the model/target; check the runtime and licence [4–6] |
| Roboflow | Organising image sets, drawing boxes, checking data and training | Dataset export is separate from model weights export; the ability to download weights depends on the model and plan [7–9] |
| Google Teachable Machine | Beginners learning image classification | You can try it through a camera and use the model in a program, but an Image Project is not a multi-object box detector [10–11] |
| Google Colab | Those ready to use Python and customise the training steps | A cloud computing notebook that needs training code such as Ultralytics; it has resource limits and does not guarantee a GPU [12] |
Recommended starting approach: Use Edge Impulse if you want to see the steps through to an edge board in one system, or Ultralytics Platform if you want to learn YOLO and export models in several formats. Use Roboflow when the focus is managing images and annotation, checking export rights before starting work. Teachable Machine suits introductory lessons on image classification
Edge Impulse: from images to an edge board
- Create an account and a project, check the Private setting before uploading images, then choose the Object detection task
- Add images and draw bounding boxes for each class; keep test images from different scenes or capture sessions
- Create an impulse, choose the image processing and learning block, then Train and run Model testing
- Go to Deployment, choose a supported target, and test the results on a computer or Linux before taking the package to a real board
There is a Developer plan for experimenting, with conditions separate from Enterprise. Data in a private project is still processed by the cloud service under the provider's terms; it does not mean everything runs only on your machine. If you choose FOMO, understand that the output is centre points, with limitations when objects are close together [1–3, 13]
Open Studio → · Deployment guide · GitHub Linux Python SDK
Ultralytics Platform: train and export YOLO
- Create a dataset/project, check visibility, then upload images and define classes, such as
parcel - Draw object boxes, check annotations and split train/validation/test before choosing a model and starting Train
- Review the evaluation results and misdetected images; keep the test set for checking new versions without using it for training
- Download weights or Export in a format that matches the device, such as ONNX for a supported runtime, then test with new video
Check training service costs and model rights before starting. The AGPL-3.0 and Enterprise licences have different conditions. A successful export does not guarantee speed or compatibility with every board; for TensorRT in particular, check the runtime version and target hardware [4–6]
Open Platform → · Export guide · GitHub Ultralytics
Roboflow: organise data and train while checking export conditions
- Check the workspace plan and privacy before creating an Object Detection project
- Upload images, Annotate boxes and classes, then create a dataset version with a test set
- Choose a supported model, Train, and check results on images the model has not seen
- Check Supported Models to see whether this model and plan allow downloading weights, or how Roboflow Inference can be used on hardware, before choosing a deployment method
The documentation states that the free plan makes datasets and models public on Universe, while paid plans/trials have private data subject to plan conditions. Do not use a public project for images you do not want published . Clicking Export Dataset gives image files and labels; it is not evidence that the trained model can be downloaded [7–9]
Open Roboflow → · Check models and export · GitHub Inference
Teachable Machine: learn image classification before location detection
- Open an Image Project and create classes such as “has parcel” and “other scene”
- Add images from several angles and scenes, then Train and try new images in Preview
- Open Export Model, choose a format supported by the target program, such as TensorFlow.js, and download the files with labels
- Test on a computer first. If you need locations of multiple objects, switch to Object detection
The website states that you can choose on-device use, in which camera/microphone data does not leave the device, but saving to the cloud or publishing a link is a separate action that must be checked separately; do not assume every saving method is local [10–11]
Open Teachable Machine → · GitHub Image library example
Colab: train with Python when you are ready to adapt code
- Open a notebook whose provenance can be verified, such as examples on the library's official GitHub, and read the code before Run all
- Prepare data you have the right to use, specify the dataset split, then choose a runtime according to the resources allocated
- Install the specified versions, train and evaluate with a separate test set
- Download the weights, labels, configuration and evaluation results before the runtime ends, then test inference on Windows/Linux
Colab is not a website that draws boxes and trains end to end automatically. Free resources are limited and can change. Be careful with Drive permissions and data in shared notebooks, and do not put API keys in published cells [12]
Open Colab → · Limitations and FAQ
Security checks before uploading images
This list was selected from the providers' domains and verifiable official documents; it is not a certification of being risk-free or having passed penetration testing . Start with images of objects you created or photographed yourself that contain no sensitive data, then check the following before using real data
- Check that the project, dataset and model are private as intended, including collaborator permissions and conditions when changing plans
- Read the data use, deletion and backup policies, especially for images of people, EXIF coordinates and images of restricted areas; private data in the cloud is still sent to the provider for processing
- Access the websites via official links, use a password unique to the account, enable MFA when the service supports it, and keep API keys out of public code
- Check the licences of data, code, weights and services separately, including rights for commercial use and model distribution
Ultralytics has a policy separating customer content from content users voluntarily make public, while Edge Impulse describes processing and Usage Data in its terms of service; read the terms that match your account type [6, 13–14]
Steps for moving a model from the web to a drone
Images and annotation boxes → training → evaluation → model export → PC testing → board and camera testing → integration with the drone system
- Choose an example task such as detecting parcels. Collect images at various distances, angles and lighting, plus images without the target object. Do not use only close-up product images if the real camera will look from above
- Before training, check what kind of model the drone's board or SDK accepts; some off-the-shelf drones do not allow adding your own models
- Export the model file together with labels, input size, RGB/BGR, normalization and the post-processing method . Keep the version number and licence so it can be rerun
- Open recorded video on Windows/Linux, check the boxes and object counts, measure precision/recall, p95 latency and resources, then compare before/after quantization
- Take the package to companion computer , such as a supported Linux board. The camera sends images to the inference program, which returns the class, confidence and position in the image. Start by displaying or logging the results on a test bench
- Connect to the drone software via the SDK/ROS supported by the system after testing the board. Pixel positions in the image are not yet world coordinates or distances to the object; calibration and additional geometric data are required [15]
If video is processed at the ground station instead of on an onboard board, latency and signal dropouts must also be tested. Running a model offline on a device must be verified by actually cutting the internet connection, because displaying results through a hosted API still depends on the network
Web tool verification status: The providers' guides and terms have been checked, but no images have been uploaded or models trained through these web services, and nothing has been tested on a real drone. The offline training experiment reported above is separate work. There is no guarantee that a single file works with every drone brand
Bibliography: web platforms for training AI and deployment
Website entries without a year use “n.d.”; all entries were retrieved on 7 September B.E. 2569 (2026)
- Edge Impulse. (n.d.). Object detection.
- Edge Impulse. (n.d.). Deployment.
- Edge Impulse. (n.d.). Introducing the Developer Plan.
- Ultralytics. (n.d.). Trained Model Management.
- Ultralytics. (n.d.). Model Export with Ultralytics YOLO.
- Ultralytics. (n.d.). Licensing.
- Roboflow. (n.d.). Create a Project.
- Roboflow. (n.d.). Supported Models.
- Roboflow. (n.d.). Pricing and Plans.
- Google Creative Lab. (n.d.). Teachable Machine.
- Google Creative Lab. (n.d.). Teachable Machine Image Library.
- Google. (n.d.). Colaboratory Frequently Asked Questions.
- Edge Impulse. (n.d.). Developer Plan Terms of Service and Privacy Policy.
- Ultralytics. (2026, June 22). Privacy Policy.
- PX4. (n.d.). Companion Computers, User Guide v1.14. Used as a reference for separating the roles of the flight controller and the companion computer; check the guide for your model before integrating a real system
Further reading and references
- Source document: DTI, Computer_vision_v1
- OpenCV camera calibration
- ONNX Runtime Python
- Ultralytics licensing
- Original Computer Vision and mapping
- Embedded AI and ROS
This content was compiled from documents kindly contributed by DTI and the references above. Numerical examples are cases for learning. Read theacknowledgements and content sources
F15: where does a 3D point land in pixels?
| Variable | Meaning and units in → out | Range/source of values |
|---|---|---|
| X,Y,Z | Coordinates in the camera frame, m (in) | finite, Z > 0; X right, Y down, Z forward |
| fx,fy | Focal length along the image axes, px (in) | > 0; calibration at the same resolution |
| cx,cy | Principal point, px (in) | finite; not required to be the image centre |
| S,f | Sensor width and focal length, mm (in) | > 0; same units and the same active sensor |
| u,v,FOV | Image point, px, and horizontal field of view, deg (out) | finite; the point may lie outside the image; 0 < FOV < 180° |
Applied level · Question: which pixel does a point in the camera frame project to? Uses a pinhole model without distortion, following OpenCV 4.10.0
u = fx X/Z + cx; v = fy Y/Z + cy
FOV_horizontal = 2 atan(S/(2f)) × 180/π
X/Z is dimensionless, so multiplying by fx gives px; atan gives rad before converting to deg. This FOV formula assumes an image frame symmetric about the optical axis and must not be used for an off-axis crop without correcting the geometry. The example is a synthetic camera, not a real hardware model
A world point must be transformed into the camera frame before using the formula. Z=0 cannot be divided by, and Z<0 is behind the camera. Fisheye/distortion is not supported. After resize/crop, the intrinsics must be adjusted to match the new image. FOV is a geometric boundary and does not guarantee object detection
Worked substitution example
Let X=1 m, Y=0.5 m, Z=5 m, fx=fy=800 px, cx=640 px, cy=360 px, giving u=800×1/5+640=800 px and v=800×0.5/5+360=440 px. Separately, compute FOV from S=12.8 mm, f=8 mm: 2atan(0.8)=1.349481884 rad=77.319617° (image 1280×720 px, active sensor 12.8×7.2 mm, hence consistent with fx=fy=800 px)
Exercise: change the values
Increase Z to 10 m, keeping X, Y and the same camera. How do the image point and FOV change?
Show F15 answer
u=720 px, v=400 px; the distance from (640,360) halves, while FOV=77.319617° stays the same. Tolerance ±0.001 px and ±0.000001°
Reference: OpenCV 4.10.0, Camera Calibration and 3D Reconstruction (P3E06); checked 26 September B.E. 2569 (2026)
Download the basic formula answer-check set (JSON) · synthetic data with units, for comparing your own calculation results
Download the engineering and sensor formula practice set (CSV/JSON with answers) · synthetic data for practising calculations and checking assumptions