Overview
BeamFinder outputs all detections to a CSV file atoutput/detections.csv. Each row represents one detected drone bounding box.
The CSV is generated in detect.py:30-48 during the prediction loop.
CSV Schema
The output CSV has 7 columns written atdetect.py:32:
Field Descriptions
Source image filename (basename only, no path).Extracted from
Path(r.path).name at detect.py:40.Example: test_001.jpgBounding box center X coordinate in pixels (absolute, not normalized).Extracted from
box.xywh[0][0] and rounded to 2 decimal places at detect.py:44.Range: 0 to image widthExample: 512.34Bounding box center Y coordinate in pixels (absolute, not normalized).Extracted from
box.xywh[0][1] and rounded to 2 decimal places at detect.py:44.Range: 0 to image heightExample: 384.67Bounding box width in pixels.Extracted from
box.xywh[0][2] and rounded to 2 decimal places at detect.py:44.Example: 128.45Bounding box height in pixels.Extracted from
box.xywh[0][3] and rounded to 2 decimal places at detect.py:44.Example: 96.23Detection confidence score (0-1).Extracted from
box.conf.item() and rounded to 4 decimal places at detect.py:46.Only detections with confidence >= CONF (default 0.4) are included.Range: 0.0 to 1.0Example: 0.8734Detected object class name.Mapped from class ID using
r.names[int(box.cls.item())] at detect.py:47.For BeamFinder, this is always "drone" since there’s only one class.Example: droneExample Output
Sample CSV Content
Multiple Detections Per Image
If an image contains multiple drones, each detection is written as a separate row with the sameimage value.
Example from test_001.jpg above:
- Detection 1: confidence 0.8734 at (512.34, 384.67)
- Detection 2: confidence 0.7621 at (1024.12, 720.89)
Coordinate System
Absolute Pixel Coordinates
All coordinates are in absolute pixels, not normalized [0,1] values.- Origin (0, 0) is at the top-left corner of the image
- X increases rightward
- Y increases downward
Converting to Corner Format
The CSV uses center-width-height format (xywh). To convert to corner coordinates (xyxy):Converting to Normalized Coordinates
To normalize coordinates for input to other systems:Filtering & Thresholds
Confidence Threshold
TheCONF parameter in detect.py:12 controls which detections are saved:
- Higher Confidence (Precision)
- Lower Confidence (Recall)
Increase
CONF to reduce false positives:- Fewer false alarms
- May miss some true drones
- Recommended for production deployment
Post-Processing Filters
You can apply additional filters after detection:Output Statistics
The detection script prints a summary when complete (detect.py:50):
Annotated Images
In addition to the CSV, BeamFinder saves annotated images with bounding boxes drawn atoutput/annotated/.
These images are generated by the save=True parameter in model.predict() at detect.py:36.
Annotation Style
- Green boxes for detections above confidence threshold
- Confidence score displayed on each box
- Class label (“drone”) displayed on each box
Annotated images are for visualization only. All downstream processing should use the CSV file for accurate coordinates.