Expand support for date formats in image filenames#809
Merged
Conversation
✅ Deploy Preview for antenna-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR expands support for image filename timestamp formats by enhancing the date extraction function, updating error messages, and adding comprehensive tests. Key changes include:
- Enhancements to get_image_timestamp_from_filename to support delimited date/time formats.
- Updated user-facing error messages and language strings for invalid timestamps.
- New tests covering multiple timestamp patterns in filenames.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/src/utils/language.ts | Updated message text for timestamp requirements. |
| ami/utils/tests.py | Added tests to validate the new flexible timestamp extraction logic. |
| ami/utils/dates.py | Expanded regex patterns and error handling for various timestamp formats. |
| ami/main/models.py | Updated error message in validate_filename_timestamp for consistency. |
| ami/main/api/serializers.py | Modified image validation to use the new filename timestamp validation. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mihow
added a commit
that referenced
this pull request
Apr 30, 2025
* feat: support more date formats in filenames * feat: update and centralize validation language
mihow
added a commit
that referenced
this pull request
Aug 16, 2025
* Set up customizable local processing service * Set up separate docker compose stack, rename ml backend services * WIP: README.md * Improve processing flow * fix: tests and postgres connection * Update READMEs with minimal/example setups * fix: transformers fixed version * Add tests * Typos, warn --> warnings * Add support for Darsa flat-bug * chore: Change the Pipeline class name to FlatBugDetectorPipeline to avoid shadowing the FlatBugDetector model * Move README * Address comment tasks * Update README * Pass in pipeline request config, properly cache models, simplifications * fix: update docker compose instructions & build path * feat: use ["insect"] for the default zero-shot class * feat: try to use faster version of zero-shot detector * feat: use gpu if available * fix: update minimal docker compose build path * Add back crop_image_url * Support re-processing detections and skipping localizer * fix: correctly pass candidate labels for zero shot object detector * Support re-processing detections and skipping localizer * fix: allow empty pipeline request config * fix: allow empty pipeline request config * clean up * fix: ignore detection algorithm during reprocessing * remove flat bug * feat: only use zero shot and HF classifier algorithms * clean up * Expand support for date formats in image filenames (#809) * feat: support more date formats in filenames * feat: update and centralize validation language * fix: change name of the new docker network (#819) * docs: clarify new Detection schema/class * Function for creating detection instances from requests * Add reprocessing to minimal app * Add re-processing test * Fix requirements * Address review comments * Only open source image once * feat: cache huggingface & torch models that are auto-downloaded * fix: leave gpu passthrough as an example, off by default * feat: feature flag & pipeline config for reprocessing detections * fix: spelling in previous feature flag * chore: migration for new & corrected feature flags * fix: append detections instead of overriding. add feature flag to tests. --------- Co-authored-by: mohamedelabbas1996 <hack1996man@gmail.com> Co-authored-by: Michael Bunsen <notbot@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Previously we only supported filenames with timestamps that match YYYYMMDDHHMMSS. This works for all AMI systems, but not users of other camera systems. We now support timestamps that contain delimiters between the date components e.g. YYYY-MM-SS HH:MM:SS. This should reduce frustration while users are testing images from new cameras using the manual image upload interface.
We are avoiding reading EXIF data because it requires reading the file contents, which is not an option when indexing images during the batch sync. If we separate the manual/single image uploads from batch syncing then we can considering reading EXIF. Or perhaps it can be done with javascript on the client machine? TOTRY!
Checklist