Conversation
|
@SMRayeed, could you please add a requirements file and README describing the process with these scripts in the folder? |
Added README for the BioREPO Detection Pipeline, detailing installation, usage, modules, and output structure.
egrace479
left a comment
There was a problem hiding this comment.
Assuming you don't want to rename the folder, the references to it need to be updated.
Otherwise, this looks fine.
There was a problem hiding this comment.
Pull request overview
Adds a new detection-pipeline/ package containing scripts and documentation for detecting beetles (Grounding DINO), colorpickers (Moondream), and scalebars (Moondream) from tray images, along with pinned-ish runtime dependencies.
Changes:
- Introduces three new detection runner scripts for beetles, colorpickers, and scalebars.
- Adds a pipeline README describing usage, SLURM chunking, inputs/outputs, and credential setup.
- Adds a
requirements.txtcapturing the Python dependencies for the pipeline.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| detection-pipeline/requirements.txt | Adds dependency list for running the detection scripts. |
| detection-pipeline/README.md | Documents pipeline purpose, setup, credentials, and how to run each module. |
| detection-pipeline/detection_scalebar.py | Implements Moondream-based scalebar detection with overlap/area filtering and resumable output. |
| detection-pipeline/detection_colorpicker.py | Implements Moondream-based colorpicker detection with overlap reconciliation and CSV logging. |
| detection-pipeline/detection_beetles.py | Implements Grounding DINO-based beetle detection, cropping, and results logging. |
Comments suppressed due to low confidence (1)
detection-pipeline/README.md:74
- The install instructions
cd BioREPO-Processingpoint to a directory that doesn’t exist in this repo. Update it to the actual subdirectory so the quickstart works copy/paste.
cd BioREPO-Processing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with open(csv_path, "w", newline="") as csvfile: | ||
| fieldnames = ["image_name", "plotted_image", "num_colorpickers", "colorpicker_coords", "verify"] | ||
| writer = csv.DictWriter(csvfile, fieldnames=fieldnames) | ||
| writer.writeheader() | ||
| writer.writerows(rows) | ||
|
|
| iou = calculate_iou(all_detected_boxes[0], all_detected_boxes[1]) | ||
| if iou >= 0.6: | ||
| merged_box = { | ||
| "x_min": int((all_detected_boxes[0]["x_min"] + all_detected_boxes[1]["x_min"]) / 2), | ||
| "y_min": int((all_detected_boxes[0]["y_min"] + all_detected_boxes[1]["y_min"]) / 2), | ||
| "x_max": int((all_detected_boxes[0]["x_max"] + all_detected_boxes[1]["x_max"]) / 2), | ||
| "y_max": int((all_detected_boxes[0]["y_max"] + all_detected_boxes[1]["y_max"]) / 2), | ||
| } | ||
| return [merged_box], False |
| self.processor = AutoProcessor.from_pretrained(model_id) | ||
| self.model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(self.device) | ||
|
|
||
| self.llava_processor, self.llava_model = self.setup_llava_model() |
| image = Image.open(image_path) | ||
| image.verify() | ||
| image = Image.open(image_path).convert("RGB") |
Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com>
Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com>
|
@egrace479 based on the remarks of the Copilot, I revisited the codebase and found the issues for the detection_beetles.py script and fixed. Also, updated the csv-logging part for colorpicker and scalebar as suggested. |
I have added the updated scripts for detecting individual beetles, colorpickers, and scalebars.