Skip to content

Beetle, Colorpicker, Scalebar detection scripts - #10

Open
SMRayeed wants to merge 12 commits into
mainfrom
detection
Open

Beetle, Colorpicker, Scalebar detection scripts #10
SMRayeed wants to merge 12 commits into
mainfrom
detection

Conversation

@SMRayeed

Copy link
Copy Markdown
Member

I have added the updated scripts for detecting individual beetles, colorpickers, and scalebars.

@egrace479

Copy link
Copy Markdown
Member

@SMRayeed, could you please add a requirements file and README describing the process with these scripts in the folder?

@AlysonEast
AlysonEast requested a review from egrace479 July 14, 2026 17:45

@egrace479 egrace479 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you don't want to rename the folder, the references to it need to be updated.

Otherwise, this looks fine.

Comment thread detection-pipeline/README.md Outdated
Comment thread detection-pipeline/README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.txt capturing 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-Processing point 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.

Comment thread detection-pipeline/README.md Outdated
Comment on lines +154 to +159
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)

Comment on lines +78 to +86
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
Comment thread detection-pipeline/detection_beetles.py Outdated
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()
Comment thread detection-pipeline/detection_beetles.py Outdated
Comment on lines +207 to +209
image = Image.open(image_path)
image.verify()
image = Image.open(image_path).convert("RGB")
SMRayeed and others added 3 commits August 12, 2026 14:50
Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com>
Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com>
@SMRayeed

Copy link
Copy Markdown
Member Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants