Skip to content

Expand support for date formats in image filenames#809

Merged
mihow merged 4 commits into
mainfrom
feat/date-formats
Apr 29, 2025
Merged

Expand support for date formats in image filenames#809
mihow merged 4 commits into
mainfrom
feat/date-formats

Conversation

@mihow
Copy link
Copy Markdown
Collaborator

@mihow mihow commented Apr 17, 2025

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

  • I have tested these changes appropriately.
  • I have added and/or modified relevant tests.
  • I updated relevant documentation or comments.
  • I have verified that this PR follows the project's coding standards.
  • Any dependent changes have already been merged to main.

Copilot AI review requested due to automatic review settings April 17, 2025 02:53
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2025

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit 01c8a55
🔍 Latest deploy log https://app.netlify.com/sites/antenna-preview/deploys/68006d9149f1010008f5290e
😎 Deploy Preview https://deploy-preview-809--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 75 (🔴 down 5 from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread ami/main/models.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mihow mihow merged commit 54d670a into main Apr 29, 2025
6 checks passed
@mihow mihow deleted the feat/date-formats branch April 29, 2025 13:36
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>
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.

2 participants