Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions changes/239.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Fix detect() function not accepting different file_col parameter (Issue #239)

## Problem
The `detect()` function accepts a `file_col` parameter to specify which column in a manifest contains file paths, but it was not passing this parameter to the `manifest_dataloader()` function. This caused the dataloader to always use the default 'filepath' column, resulting in errors when users specified a custom column name.

## Solution
Added the `file_col` parameter to the `manifest_dataloader()` call in the `detect()` function, ensuring that custom file path column names are properly propagated through the data pipeline.

## Changes
- `src/animl/detection.py`: Updated line 206 to pass `file_col=file_col` to `manifest_dataloader()`

## Testing
- Added unit tests to verify that custom `file_col` values are properly passed to the dataloader
- Verified that default behavior (file_col='filepath') is maintained
2 changes: 1 addition & 1 deletion src/animl/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def detect(detector,
device = get_torch_device(user_set=device, quiet=True)

# create dataloader
dataloader = manifest_dataloader(manifest, batch_size=batch_size,
dataloader = manifest_dataloader(manifest, file_col=file_col, batch_size=batch_size,
num_workers=num_workers, crop=False,
normalize=True, letterbox=letterbox,
resize_width=resize_width,
Expand Down