You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Advanced pipeline using **Grounding DINO** for automated beetle detection and segmentation.
145
+
Advanced pipeline using **Grounding DINO** for automated beetle detection and segmentation. `scripts/beetle_detection.py` is this notebook converted to a runnable script. An example minimal run (passing only required parameters) is provided below:
146
+
147
+
```console
148
+
python scripts/beetle_detection.py \
149
+
--csv_path data/metadata.csv \
150
+
--image_dir data/group_images \
151
+
--save_folder data/individual_images \
152
+
--output_csv data/processed.csv
153
+
```
154
+
155
+
Additional optional parameters that can be passed are as follows:
156
+
-`model_id`: Model ID for Grounding-DINO, default is `IDEA-Research/grounding-dino-base`.
157
+
-`text`: Text prompt for detection, default is `"a beetle."`.
158
+
-`box_threshold`: Box threshold for detection, default is `0.2`.
159
+
-`text_threshold`: Text threshold for detection,default is `0.2`.
160
+
-`padding`: Padding factor for cropping, default is `0.1`.
161
+
-`iou_threshold`: IoU threshold for Non-Maximum Suppression (NMS), default is `0.6`.
145
162
146
163
**Workflow:**
147
164
1. Load beetle measurements from the [2018 NEON Ethanol-preserved Ground Beetles dataset](https://huggingface.co/datasets/imageomics/2018-NEON-beetles)
148
-
2. Initialize Grounding DINO model (IDEA-Research/grounding-dino-base)
165
+
2. Initialize Grounding DINO model
149
166
3. For each image:
150
167
- Detect beetles using text prompt ("a beetle")
151
168
- Filter detections based on adaptive area thresholds
0 commit comments