# \#code

**URL:** https://community.ultralytics.com/tag/code/78.md

[Latest](https://community.ultralytics.com/latest.md) · [Categories](https://community.ultralytics.com/categories.md) · [Tags](https://community.ultralytics.com/tags.md)

---

## [yolo26 seg merge depth detect](https://community.ultralytics.com/t/yolo26-seg-merge-depth-detect/2200)

<div class="topic-metadata">

**Author:** [@korol](https://community.ultralytics.com/u/korol)\
**Replies:** 3\
**Last updated:** [September 10, 2026, 12:59am UTC](https://community.ultralytics.com/t/yolo26-seg-merge-depth-detect/2200 "2026-09-10T00:59:07Z")

</div>

I recently combined YOLO26’s segmentation detection with depth detection, using the same backbone network for both and splitting it into two different task heads. A single inference outputs both segmentation and depth in…

---

## [Best approach for a system that detects acts of violence/ violent behaviour from cctv footage](https://community.ultralytics.com/t/best-approach-for-a-system-that-detects-acts-of-violence-violent-behaviour-from-cctv-footage/2183)

<div class="topic-metadata">

**Author:** [@Joe\_Joe](https://community.ultralytics.com/u/Joe_Joe)\
**Replies:** 1\
**Last updated:** [August 23, 2026, 1:39pm UTC](https://community.ultralytics.com/t/best-approach-for-a-system-that-detects-acts-of-violence-violent-behaviour-from-cctv-footage/2183 "2026-08-23T13:39:57Z")

</div>

This project has been on my mind for a while now but it probably is far from my technical abilities i would just like to know the best approach Thanks

---

## [Replacing C3k2 with RepViT in YOLO11 While Reusing Pretrained Weights](https://community.ultralytics.com/t/replacing-c3k2-with-repvit-in-yolo11-while-reusing-pretrained-weights/2166)

<div class="topic-metadata">

**Author:** [@Hieu\_Nguyen\_Duc](https://community.ultralytics.com/u/Hieu_Nguyen_Duc)\
**Replies:** 1\
**Last updated:** [August 13, 2026, 6:15pm UTC](https://community.ultralytics.com/t/replacing-c3k2-with-repvit-in-yolo11-while-reusing-pretrained-weights/2166 "2026-08-13T18:15:21Z")

</div>

I am exploring waste detection and I want to replace the C3k2 blocks in the YOLO11 backbone with RepViT modules, while keeping the original YOLO11 neck and detection head. My main goal is to reuse the pretrained weights…

---

## [I want precdict threading](https://community.ultralytics.com/t/i-want-precdict-threading/2100)

<div class="topic-metadata">

**Author:** [@yuns](https://community.ultralytics.com/u/yuns)\
**Replies:** 2\
**Last updated:** [July 6, 2026, 10:48pm UTC](https://community.ultralytics.com/t/i-want-precdict-threading/2100 "2026-07-06T22:48:38Z")

</div>

I want to perform inference on an array of 500 images using threads. Ask AI said to use it thie way but, this code Thread collision error -\> not use predict Thread error from threading import Thread from ultralytics …

---

## [What is the best pose detection and motion tracking?](https://community.ultralytics.com/t/what-is-the-best-pose-detection-and-motion-tracking/1982)

<div class="topic-metadata">

**Author:** [@Curtis](https://community.ultralytics.com/u/Curtis)\
**Replies:** 1\
**Last updated:** [May 22, 2026, 1:19am UTC](https://community.ultralytics.com/t/what-is-the-best-pose-detection-and-motion-tracking/1982 "2026-05-22T01:19:00Z")

</div>

I am 100 videos deep in individually pausing and pressing play every few seconds of a 18 second video of a surfer surfing in a wave pool. I have created a formula for a scoring output for each individual manoeuvre and ac…

---

## [Help with counting shot gun pellet holes on paper](https://community.ultralytics.com/t/help-with-counting-shot-gun-pellet-holes-on-paper/1980)

<div class="topic-metadata">

**Author:** [@Tjedor](https://community.ultralytics.com/u/Tjedor)\
**Replies:** 1\
**Last updated:** [May 20, 2026, 1:20am UTC](https://community.ultralytics.com/t/help-with-counting-shot-gun-pellet-holes-on-paper/1980 "2026-05-20T01:20:08Z")

</div>

Hey, Not sure if this is he right place to ask, but giving it a shot. Looking for some help, tips or tricks on building a robust and accurate model for pellet hole detection to analyze swarm patterns. I have so far rel…

---

## [Modifying yolo11 architecture to have one backbone and 2 necks and heads](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846)

<div class="topic-metadata">

**Author:** [@big\_tree](https://community.ultralytics.com/u/big_tree)\
**Replies:** 7\
**Last updated:** [May 15, 2026, 11:11am UTC](https://community.ultralytics.com/t/modifying-yolo11-architecture-to-have-one-backbone-and-2-necks-and-heads/846 "2026-05-15T11:11:04Z")

</div>

Hi, I am interested in modifying the architecture of yolo11. I want to keep the backbone as it is, and attach it to 2 necks and heads. My goal is to freeze the pretrained backbone and train the two necks to detect diffe…

---

## [YOLO26n-Pose in Xcode](https://community.ultralytics.com/t/yolo26n-pose-in-xcode/1903)

<div class="topic-metadata">

**Author:** [@Spencer\_A](https://community.ultralytics.com/u/Spencer_A)\
**Replies:** 3\
**Last updated:** [March 29, 2026, 1:38pm UTC](https://community.ultralytics.com/t/yolo26n-pose-in-xcode/1903 "2026-03-29T13:38:12Z")

</div>

Hello, I am trying to run a yolo26n-pose model on my iphone and I am using xcode to do this. I have read the yolo on ios documentation on github, and have followed the instructions regarding converting the model to coreM…

---

## [System Freeze When Performing Heavy Yolo Inferencing](https://community.ultralytics.com/t/system-freeze-when-performing-heavy-yolo-inferencing/1882)

<div class="topic-metadata">

**Author:** [@Christian\_G\_A](https://community.ultralytics.com/u/Christian_G_A)\
**Replies:** 7\
**Last updated:** [March 25, 2026, 4:53pm UTC](https://community.ultralytics.com/t/system-freeze-when-performing-heavy-yolo-inferencing/1882 "2026-03-25T16:53:43Z")

</div>

Hello, I have been using YOLO inferencing for about a year to analyze 24 camera feeds. I have one dedicated computer for this purpose, a new ASUS desktop that has powerful specs. The inference runs about every 1 second …

---

## [YOLOv26 Beginner Questions: Human + Hand + Action Keypoints Annotation](https://community.ultralytics.com/t/yolov26-beginner-questions-human-hand-action-keypoints-annotation/1862)

<div class="topic-metadata">

**Author:** [@Time](https://community.ultralytics.com/u/Time)\
**Replies:** 1\
**Last updated:** [March 13, 2026, 8:24am UTC](https://community.ultralytics.com/t/yolov26-beginner-questions-human-hand-action-keypoints-annotation/1862 "2026-03-13T08:24:11Z")

</div>

Hi everyone, I’m a beginner with YOLOv26 and just started exploring human and hand keypoint annotation. I have several questions regarding labeling and configuration and would appreciate any guidance from the community: …

---

## [Full\_integer\_quant on YOLO26n](https://community.ultralytics.com/t/full-integer-quant-on-yolo26n/1843)

<div class="topic-metadata">

**Author:** [@carlos](https://community.ultralytics.com/u/carlos)\
**Replies:** 1\
**Last updated:** [March 3, 2026, 4:57pm UTC](https://community.ultralytics.com/t/full-integer-quant-on-yolo26n/1843 "2026-03-03T16:57:55Z")

</div>

Hello! I am trying to export yolo26n quantized, I tried with NMS free end2end=False, I tested and it works correctly with the post processing for the boxes. When I try with the NMS-baked in (default) I am not getting c…

---

## [NMS input shape expected by detect/val.py after custom head, is it (B,4+nc,N) or (B,N,4+nc)?](https://community.ultralytics.com/t/nms-input-shape-expected-by-detect-val-py-after-custom-head-is-it-b-4-nc-n-or-b-n-4-nc/1786)

<div class="topic-metadata">

**Author:** [@djikstra0501](https://community.ultralytics.com/u/djikstra0501)\
**Replies:** 4\
**Last updated:** [February 6, 2026, 2:38am UTC](https://community.ultralytics.com/t/nms-input-shape-expected-by-detect-val-py-after-custom-head-is-it-b-4-nc-n-or-b-n-4-nc/1786 "2026-02-06T02:38:21Z")

</div>

I use YOLO11n. I modified the detection head + tasks.py output. Training/val runs without crashing, but mAP/precision/recall are all 0, which makes me suspect my prediction tensor layout doesn’t match what val.py’s NMS e…

---

## [Yolov8n-cls has a background class?](https://community.ultralytics.com/t/yolov8n-cls-has-a-background-class/1789)

<div class="topic-metadata">

**Author:** [@Davide\_Cascella](https://community.ultralytics.com/u/Davide_Cascella)\
**Replies:** 2\
**Last updated:** [February 5, 2026, 1:19pm UTC](https://community.ultralytics.com/t/yolov8n-cls-has-a-background-class/1789 "2026-02-05T13:19:26Z")

</div>

Hello i’m doing transfer learning on yolov8n-cls, with this script: from ultralytics import YOLO model = YOLO('yolov8n-cls.pt') print(model.names) results = model.train( data='./dataset', epochs=25, …

---

## [Can we add a loss function to yolo?](https://community.ultralytics.com/t/can-we-add-a-loss-function-to-yolo/1782)

<div class="topic-metadata">

**Author:** [@hanyunuk](https://community.ultralytics.com/u/hanyunuk)\
**Replies:** 3\
**Last updated:** [January 30, 2026, 12:58pm UTC](https://community.ultralytics.com/t/can-we-add-a-loss-function-to-yolo/1782 "2026-01-30T12:58:00Z")

</div>

I’m planning to add a loss function to perform 3D recognition and other tasks. I’m also preparing a dataset accordingly. Is it possible to add a loss function?

---

## [Implementing Knowledge Distillation with YOLO11N Student and YOLO11M Teacher in Ultralytics Trainer](https://community.ultralytics.com/t/implementing-knowledge-distillation-with-yolo11n-student-and-yolo11m-teacher-in-ultralytics-trainer/1743)

<div class="topic-metadata">

**Author:** [@AA278-HUB](https://community.ultralytics.com/u/AA278-HUB)\
**Replies:** 8\
**Last updated:** [January 21, 2026, 4:56am UTC](https://community.ultralytics.com/t/implementing-knowledge-distillation-with-yolo11n-student-and-yolo11m-teacher-in-ultralytics-trainer/1743 "2026-01-21T04:56:55Z")

</div>

Hi Ultralytics community, I am working on a lightweight model based on YOLO11N. I didn’t change the detect layer, but as expected, the accuracy dropped compared to the original model. To recover the lost performance, I …

---

## [YOLOv11 uses multiple heads(classification+segmentation) during training](https://community.ultralytics.com/t/yolov11-uses-multiple-heads-classification-segmentation-during-training/1692)

<div class="topic-metadata">

**Author:** [@hanieh\_mosaali](https://community.ultralytics.com/u/hanieh_mosaali)\
**Replies:** 1\
**Last updated:** [December 11, 2025, 10:46am UTC](https://community.ultralytics.com/t/yolov11-uses-multiple-heads-classification-segmentation-during-training/1692 "2025-12-11T10:46:44Z")

</div>

I want to train YOLOv11 on my dataset in a multi-head setup, so that during training it learns both classification and segmentation. Specifically, when it learns segmentation, it should also learn the class of the segme…

---

## [Yolov8 architecture modifying for multi-label classification](https://community.ultralytics.com/t/yolov8-architecture-modifying-for-multi-label-classification/1641)

<div class="topic-metadata">

**Author:** [@Sarvin](https://community.ultralytics.com/u/Sarvin)\
**Replies:** 3\
**Last updated:** [November 21, 2025, 12:30pm UTC](https://community.ultralytics.com/t/yolov8-architecture-modifying-for-multi-label-classification/1641 "2025-11-21T12:30:36Z")

</div>

Hey Ultralytics community! I’m working on a Multi-label image Classification project using the Yolov8 classification model. To the best of my knowledge, the built-in Yolov8 classifier appears to be for single-label task…

---

## [Methods to Improve YOLOv11 Model Training Performance](https://community.ultralytics.com/t/methods-to-improve-yolov11-model-training-performance/1650)

<div class="topic-metadata">

**Author:** [@Grey\_Sky7](https://community.ultralytics.com/u/Grey_Sky7)\
**Replies:** 8\
**Last updated:** [November 20, 2025, 1:27pm UTC](https://community.ultralytics.com/t/methods-to-improve-yolov11-model-training-performance/1650 "2025-11-20T13:27:59Z")

</div>

Hey everyone, I have a question I hope you can help me with. I’m working on a project related to crop disease spot detection. Using the project dataset, which contains around 1,500 images, I trained my model. The results…

---

## [Yolov11 OBBs discarded](https://community.ultralytics.com/t/yolov11-obbs-discarded/1647)

<div class="topic-metadata">

**Author:** [@Martin\_Munoz](https://community.ultralytics.com/u/Martin_Munoz)\
**Replies:** 1\
**Last updated:** [November 19, 2025, 5:02am UTC](https://community.ultralytics.com/t/yolov11-obbs-discarded/1647 "2025-11-19T05:02:13Z")

</div>

Hi everyone, I’m training a model with YOLO11-OBB using 4-point polygon OBBs (not cx/cy/w/h/angle), and I’m running into a consistent issue: some objects are disappearing during training. The polygons are being silently…

---

## [Dicom file based computer vision project](https://community.ultralytics.com/t/dicom-file-based-computer-vision-project/1632)

<div class="topic-metadata">

**Author:** [@Joel\_Nadar](https://community.ultralytics.com/u/Joel_Nadar)\
**Replies:** 2\
**Last updated:** [November 13, 2025, 4:42am UTC](https://community.ultralytics.com/t/dicom-file-based-computer-vision-project/1632 "2025-11-13T04:42:41Z")

</div>

I am looking to build an AI-based analyzer tool that can classify and detect diagnoses based on medical imaging data. The tool should support inputs in DICOM format, as well as other formats such as JPG, PNG, and MP4. Ha…

---

## [Connecting a live Camera RP Model](https://community.ultralytics.com/t/connecting-a-live-camera-rp-model/1556)

<div class="topic-metadata">

**Author:** [@dj3000](https://community.ultralytics.com/u/dj3000)\
**Replies:** 7\
**Last updated:** [November 12, 2025, 11:43pm UTC](https://community.ultralytics.com/t/connecting-a-live-camera-rp-model/1556 "2025-11-12T23:43:06Z")

</div>

Hi I am following the examples outlined in Quick Start Guide: Raspberry Pi with Ultralytics YOLO11 The example uses a JPG image, but how can I get the data feed from a camera that is already connected to my Raspberry P…

---

## [Need advice](https://community.ultralytics.com/t/need-advice/1619)

<div class="topic-metadata">

**Author:** [@Sergey\_Suslov](https://community.ultralytics.com/u/Sergey_Suslov)\
**Replies:** 10\
**Last updated:** [November 10, 2025, 7:41am UTC](https://community.ultralytics.com/t/need-advice/1619 "2025-11-10T07:41:02Z")

</div>

Hi there! I need an advice. I have a task to count the passangeers in the bus. I have a camera looking vertically down at the door place. (Pictures attached) I have my traned model with a single class. So, in my o…

---

## [Modifying yolo architecture](https://community.ultralytics.com/t/modifying-yolo-architecture/1602)

<div class="topic-metadata">

**Author:** [@sisidipisi](https://community.ultralytics.com/u/sisidipisi)\
**Replies:** 4\
**Last updated:** [November 5, 2025, 1:04pm UTC](https://community.ultralytics.com/t/modifying-yolo-architecture/1602 "2025-11-05T13:04:14Z")

</div>

Hi everyone, I’m working on object and lane detection using YOLO, and I’ve been trying to choose a topic for my research project. We currently train two separate models for the two tasks, but I’m wondering if I could use…

---

## [Model.eval() usage in YOLO11 prediction](https://community.ultralytics.com/t/model-eval-usage-in-yolo11-prediction/1618)

<div class="topic-metadata">

**Author:** [@kiranraj](https://community.ultralytics.com/u/kiranraj)\
**Replies:** 1\
**Last updated:** [November 5, 2025, 9:49am UTC](https://community.ultralytics.com/t/model-eval-usage-in-yolo11-prediction/1618 "2025-11-05T09:49:07Z")

</div>

Hi Team, I was using my custom yolo11 model for prediction. In the exploration of improvement in the prediction pipeline, I gave this: ‘model.eval()’ to keep my model in evaluation mode. but i got an error saying that ‘…

---

## [My modified model show two different summaries](https://community.ultralytics.com/t/my-modified-model-show-two-different-summaries/1590)

<div class="topic-metadata">

**Author:** [@Mary\_C](https://community.ultralytics.com/u/Mary_C)\
**Replies:** 7\
**Last updated:** [November 1, 2025, 6:16pm UTC](https://community.ultralytics.com/t/my-modified-model-show-two-different-summaries/1590 "2025-11-01T18:16:47Z")

</div>

Please I very need to understand. I’m working on a modified yolo model but I faced this thing: I have different summary when start the training and when completed it: MM summary: 465 layers, 1,186,399 parameters, 1,186,…

---

## [How many Pre-training Epochs for YOLO11n on COCO/VOC for 4-Class Vehicle Detection (Edge Devices) should I chose empirically?](https://community.ultralytics.com/t/how-many-pre-training-epochs-for-yolo11n-on-coco-voc-for-4-class-vehicle-detection-edge-devices-should-i-chose-empirically/1555)

<div class="topic-metadata">

**Author:** [@AA278-HUB](https://community.ultralytics.com/u/AA278-HUB)\
**Replies:** 6\
**Last updated:** [October 22, 2025, 9:20am UTC](https://community.ultralytics.com/t/how-many-pre-training-epochs-for-yolo11n-on-coco-voc-for-4-class-vehicle-detection-edge-devices-should-i-chose-empirically/1555 "2025-10-22T09:20:54Z")

</div>

I’m a machine learning beginner working on a 4-class vehicle detection task (car, truck, motorcycle, bus) using the YOLO11n.yaml configuration for edge-device deployment. I plan to pre-train the model on either COCO or V…

---

## [What i miss when i modify the yolo11 structure?](https://community.ultralytics.com/t/what-i-miss-when-i-modify-the-yolo11-structure/1560)

<div class="topic-metadata">

**Author:** [@AA278-HUB](https://community.ultralytics.com/u/AA278-HUB)\
**Replies:** 4\
**Last updated:** [October 22, 2025, 9:11am UTC](https://community.ultralytics.com/t/what-i-miss-when-i-modify-the-yolo11-structure/1560 "2025-10-22T09:11:22Z")

</div>

I feel deep sorry to bother everybody again,but i do debug whole afternoon ,but still don’t know how here is problem: I change the last layer,from ‘Detect’ to ‘Detect\_DyHead’ # Parameters nc: 80 # number of classes …

---

## [Multi−GPU train - NVIDIA 5090](https://community.ultralytics.com/t/multi-gpu-train-nvidia-5090/1538)

<div class="topic-metadata">

**Author:** [@sneaky\_advisor](https://community.ultralytics.com/u/sneaky_advisor)\
**Replies:** 5\
**Last updated:** [October 9, 2025, 1:09pm UTC](https://community.ultralytics.com/t/multi-gpu-train-nvidia-5090/1538 "2025-10-09T13:09:27Z")

</div>

Windows Multi−GPU / YOLO11 from Python API won’t start multi-GPU — always runs on cuda:0 GPUs: 4× NVIDIA GeForce RTX 5090 (32 GB) Driver: 577.00 (CUDA driver 12.9) OS: Windows 11 Pro Python: 3.11.11 (Conda) PyTorch…

---

## [Replacing the YOLO 11 backbone with ResNet 50](https://community.ultralytics.com/t/replacing-the-yolo-11-backbone-with-resnet-50/1461)

<div class="topic-metadata">

**Author:** [@Naufal\_dzakwan](https://community.ultralytics.com/u/Naufal_dzakwan)\
**Replies:** 7\
**Last updated:** [October 1, 2025, 12:44am UTC](https://community.ultralytics.com/t/replacing-the-yolo-11-backbone-with-resnet-50/1461 "2025-10-01T00:44:13Z")

</div>

Hi, I’m new to the world of computer vision and object detection. I’m currently trying to replace the yolo 11 backbone with resnet 50, and this is the .yaml file that I’ve created, but I still get an error message: Runti…

---

## [How to run object detection inference with a YOLOE segmentation model?](https://community.ultralytics.com/t/how-to-run-object-detection-inference-with-a-yoloe-segmentation-model/1436)

<div class="topic-metadata">

**Author:** [@Kallinteris-Andreas](https://community.ultralytics.com/u/Kallinteris-Andreas)\
**Replies:** 7\
**Last updated:** [September 14, 2025, 2:36pm UTC](https://community.ultralytics.com/t/how-to-run-object-detection-inference-with-a-yoloe-segmentation-model/1436 "2025-09-14T14:36:16Z")

</div>

How to load YOLOE model without the segmentation head YOLOE support training for object detection, and I am trying to verify inference of an YOLOE object detection models works and benchmark it model = YOLO("yoloe-11l.…

[Next page](https://community.ultralytics.com/tag/code/78.md?match_all_tags=true&page=1&tags%5B%5D=code)
