PROJECT STUDY

CVAT Ball Auto-Labelling

Find the small ball. Keep annotations editable.

A custom CVAT adapter combining full-frame and tiled inference for small footballs, producing editable ball and person annotations.

Explore the build
Illustration of a synthetic football pitch divided into dashed inference tiles, with boxes around two players, a highlighted tile around the ball, an enlarged tile detail and a label reading Editable CVAT boxes.
Original interface illustration · Synthetic demo data.View larger

At a glance

Industry
Sports
Capabilities
6
Technologies
12
Year
2026

The challenge

In a wide camera view, a football can be only a few pixels across.

Resizing the whole frame to a detector's input size can remove the very detail needed to find it, while the players around it stay easy to see.

Annotation teams labelling match footage want useful pre-labels without giving up control: suggestions that arrive in the tool they already use, as boxes a person can accept, adjust or delete.

What we built

Weaveward built a custom detector adapter for CVAT Community, the open-source annotation platform, together with the tooling to deploy it and compare its settings.

Full-frame detection

A COCO-pretrained Ultralytics YOLO26x model finds persons and sports balls across the whole frame

Full-frame detection

A COCO-pretrained Ultralytics YOLO26x model finds persons and sports balls across the whole frame

A ball-only tiled pass

Overlapping tiles give the detector a closer look at the ball class alone, and every tile box is mapped back to full-frame coordinates

Duplicate suppression

Class-aware non-maximum suppression merges both passes into one set of boxes. An optional setting caps how many ball suggestions each frame keeps

CVAT-native output

Labelled rectangles with confidence scores return in the response format of CVAT's serverless detectors, so they arrive as ordinary, editable shapes

GPU deployment

A Nuclio function definition builds the GPU image with the model weights inside, and PowerShell helpers start CVAT with its serverless components and deploy the function on Windows

Comparison tooling

A bake-off script runs input sizes, tiling and two YOLO generations over sampled video frames, timing each setup and saving detection overlays for review

CVAT Community is an upstream open-source product by the CVAT project, and the pretrained weights come from Ultralytics. Weaveward's work is the detection adapter, the tiling and merge workflow and the integration tooling.

How it works

  1. A request from CVAT

    An annotator runs the detector on a task in CVAT, with an optional confidence threshold. The Nuclio handler decodes the base64 frame, uses 0.25 when no threshold is sent, and passes the image to a model that is loaded once per worker.

  2. The full-frame pass

    The model scans the whole frame at a 1280 px input size for persons and balls. Person boxes always come from this pass, so a tile border never splits a player.

  3. The ball-only tiles

    For frames larger than one tile, the handler cuts overlapping 640 px tiles on a 480 px stride, places the last tile flush with the far edge and runs every tile at a 960 px input size for the ball class only. Each tile's boxes shift back by its offset into full-frame pixels.

  4. Merge and review

    Torchvision's batched NMS merges both passes at an IoU threshold of 0.5 within each class. CVAT maps each result to a task label and shows it as an automatic rectangle that the annotator accepts, adjusts or deletes.

Engineering insights

The adapter is one Python model handler behind a Nuclio function on CVAT's Docker network. The weights, input sizes, tile overlap and ball cap are configuration, and the same detection code serves CVAT requests and the offline comparison.

Stack by layer

Frontend
  • CVAT Community (third-party)
Backend
  • Python
  • Nuclio
  • Pillow
Data
  • NumPy
AI
  • Ultralytics YOLO
  • YOLO26x
  • PyTorch
  • Torchvision
  • OpenCV
Infrastructure
  • Docker
  • Docker Compose
  • NVIDIA CUDA
  • PowerShell
  1. A second pass for the ball only

    The tiled pass searches only for the small object that downscaling can lose, at an input size larger than the tile itself. Persons come from the full frame alone, so the extra compute goes where objects are smallest

  2. Edge-aligned tiles without padding

    Tile origins advance by the stride and a final tile sits flush with the far edge, so the tiles cover the whole frame without padding it or repeating an origin. A single tensor add shifts each tile's boxes back to frame coordinates

  3. A class-aware merge

    NMS runs within each class, so overlapping ball boxes from the full frame and neighbouring tiles reduce to the highest-scoring one, and a person box can never suppress a ball. The optional MAX_BALLS cap then keeps only the strongest ball boxes, and the committed value of 0 keeps them all

  4. One handler for CVAT and the bake-off

    Weights, input size, tile size, tile input size, overlap and the ball cap are environment variables in the Nuclio configuration. The bake-off imports the same ModelHandler, switches setups through those variables and times each one after a warm-up call

  5. Weights baked into the GPU image

    The function image builds on the Ultralytics base image and downloads the YOLO26x weights at build time, and init_context creates the model once per worker. A request then only decodes the frame, runs both passes and formats the boxes, in FP16 on a GPU with a CPU fallback

Design system

CVAT-native suggestions: the adapter adds no screens of its own. Its output lands in CVAT's editor as ordinary person and ball rectangles, so annotators review it with the tools they already use.

Colour palette

  • Ball overlay red#ff0000Ball boxes in review overlays, drawn 3 px thick with the confidence score
  • Person overlay green#00c800Person boxes in review overlays, drawn 1 px thick
  • Colour

    The owned code defines two review colours for the bake-off overlays: red ball boxes drawn 3 px thick and green person boxes drawn 1 px thick, so the small object stands out

  • Typography

    CVAT supplies the interface type. The only text the adapter's tooling draws is each ball's confidence score, to two decimals in OpenCV's Hershey Simplex face above its box

  • Components

    The function spec declares person and ball as rectangle labels. CVAT maps each suggestion to a task label, by name unless the user sets a mapping, and its standard editing tools handle the rest

  • Human review

    Suggestions stay editable and a person makes the final label. The confidence threshold can be set for each run in CVAT's detector dialog

Where this fits

A useful annotation pipeline meets the people and tools already doing the work. We build computer vision and AI solutions around your images, camera conditions and review process. Talk to our team about your own footage.

Talk to our team

Let’s connect the dots

Let's put these ideas to work.

Share a process, product, or problem you want to improve. We will work through the possibilities together.

Discuss your project