6.0 KiB
YOLO26: 8 Computer Vision Tasks on Images (Jetson Orin Nano)
Task Title
Run 8 YOLO26 computer vision tasks on a single input image using Python.
Description
One script runs the YOLO26 model family on one image and saves every result into a results/ folder. Each task loads its own YOLO26 nano model, runs it once on the image and saves an annotated image or files.
Tasks in the script:
- Detection: boxes, class names and confidence.
- Tracking: runs the tracker on a single image. With only one frame there is no time dimension, so IDs do not persist. Use the video version for real tracking.
- Segmentation: pixel-level masks.
- Pose estimation: 17 human keypoints and skeleton (needs a person in the image).
- Classification: one label for the whole image with probability.
- ROI extraction: crops each detected box out of the image and saves each crop.
- Depth estimation: native YOLO26 depth model, saved as a colorized depth image plus the raw depth array.
- OBB (oriented bounding boxes): rotated boxes (needs aerial or satellite style images).
Hardware and Software
- Device: NVIDIA Jetson Orin Nano (JetPack with CUDA and TensorRT)
- Language: Python 3
- Libraries: ultralytics, opencv-python, numpy
- Input: one image such as
test.jpgin the same folder as the script
Installation
pip install -U ultralytics
On Jetson, install the JetPack-matched PyTorch and torchvision builds first (see the Jetson guide in the references). Model weights download automatically on first run, so the first run needs internet.
Folder Layout
your_folder/
yolo26_8_tasks_image.py (rename to match your script file name)
test.jpg (your input image)
results/ (created automatically)
Command to Run
python3 yolo26_8_tasks_image.py
To use a different image, change the image path variable at the top of the script.
Models Used
- Task 1, 2 and 6:
yolo26n.pt(detection, COCO 80 classes) - Task 3:
yolo26n-seg.pt(instance segmentation) - Task 4:
yolo26n-pose.pt(17 human keypoints) - Task 5:
yolo26n-cls.pt(ImageNet 1000 classes) - Task 7:
yolo26n-depth.pt(per-pixel metric depth in meters) - Task 8:
yolo26n-obb.pt(DOTA aerial classes)
How It Works
- The script checks that the image exists and loads it.
- Each task runs in its own
try/except, so if one task fails the others still run. - For each task the model is called on the image and
result.plot()gives the annotated image, which is saved toresults/. - ROI extraction takes the detection boxes and crops each one from the original image.
- Depth estimation reads the per-pixel depth map in meters, applies a color map and saves it as an image. It also saves the raw depth values as a
.npyfile.
Output Files (inside results/)
These are the expected names. Your script may use slightly different names, so match them to what is in your folder.
1_detection.jpg: detection result2_tracking.jpg: tracking result (single frame)3_segmentation.jpg: segmentation result4_pose.jpg: pose result5_classification.jpg: classification result with label6_roi_crops/: cropped objects, one image per detected box7_depth.png: colorized depth map7_depth.npy: raw depth values in meters8_obb.jpg: OBB result
Verify the Output
- Each finished task prints
Saved:with its path. results/contains one output per task.- Detection boxes sit on the right objects with sensible labels.
- Segmentation masks follow the object shape.
- Pose shows a skeleton on each person (only if the image has a person).
- Classification shows one label with a probability.
- ROI crops folder has one image per detected object.
- Depth image shows near and far areas in clearly different colors.
- OBB shows rotated boxes (only for aerial style images).
Notes and Limitations
- Tracking on one image cannot keep IDs across frames. It is only useful as a demo of the output format. Use the video script for real tracking.
- Pose finds human keypoints only. With no person in the image the output has no skeleton.
- OBB is trained on aerial and satellite classes, so everyday photos usually return no boxes. Test it with aerial images.
- Classification expects one main subject. If the image has many objects the label is only a rough guess.
- ROI is not a separate YOLO model. It crops the detected boxes from the original image.
Optional: Faster Inference with TensorRT
yolo export model=yolo26n.pt format=engine half=True
Then replace YOLO("yolo26n.pt") with YOLO("yolo26n.engine").
Troubleshooting
- Image not found: put the image in the script folder or fix the path in the script.
- Empty results for pose or OBB: use an image with a person (pose) or an aerial image (OBB).
- Out of memory on Jetson: close other apps or run one task at a time.
- Slow first run: weights download and the model warms up on the first call.
- Window does not open over SSH: this script saves files, so open the images from the
results/folder instead.
References
- Ultralytics YOLO26 models
- Object detection task
- Object tracking mode
- Instance segmentation task
- Pose estimation task
- Image classification task
- Oriented bounding boxes (OBB) task
- Depth estimation task
- Predict mode
- Ultralytics on NVIDIA Jetson guide
- TensorRT export
- Ultralytics GitHub
- Ultralytics on PyPI
- OpenCV image reading and writing