Skip to content

Report images missing from a VIAME CSV import instead of crashing - #2032

Merged
BryonLewis merged 1 commit into
mainfrom
csv-missing-image-import
Nov 2, 2026
Merged

BryonLewis merged 1 commit into
mainfrom
csv-missing-image-import

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

Problem

A user reported a VIAME CSV that "failed to import" with an unclear error. When the CSV names an image that is absent from the middle of the dataset's image sequence, the server parser indexed its frame map with a frame that has no entry and raised a bare KeyError. The import wrapper only recognizes ValueError as a parse failure, so the user saw:

viame.csv was not a supported file type: 500

where 500 is the CSV frame of the first detection on the missing image. The desktop parser did not throw but left those detections with an undefined frame.

Changes

  • Server and desktop parsers: a feature whose CSV frame has no mapping is skipped, whether it falls outside the found range or in a gap inside it. Track begin/end are recomputed from the retained features. A warning is placed first in the list, naming the missing images and how many detections were skipped:

    1 image(s) named in the CSV are not in this dataset, so 8 detection(s) on them were skipped. Check the image names match: SG-V3-003-20261007-195218-648.png
    

    When none of the named images match, the import keeps the CSV frame numbers (as before) and now says so with the same name hint. A blank image column produces no warning.

  • Import wrapper (crud_rpc._parse_data_item): KeyError and IndexError are reported as Failed to import <file>: ... rather than "not a supported file type".

Tests

  • server/tests/test_deserialize_viame_csv.py: mid-sequence gap, no matches, blank column.
  • client/platform/desktop/backend/serializers/viame.spec.ts: the same three cases.

Verified against the user's 8208-row CSV with one, three, first, and last images removed from the image map: no exceptions, correct track counts, warning names the images.

🤖 Generated with Claude Code

An image absent from the middle of the sequence raised KeyError on the server and
left undefined frames on desktop. Both now skip those detections and warn with the
image names; the server wrapper reports KeyError/IndexError as a parse failure.

@BryonLewis BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we are okay with now having missing images I think this PR is okay.

@BryonLewis
BryonLewis merged commit f4db6e3 into main Nov 2, 2026
3 checks passed
@BryonLewis
BryonLewis deleted the csv-missing-image-import branch November 2, 2026 17:36
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