Skip to content

Conversation

@tyrwh
Copy link
Contributor

@tyrwh tyrwh commented Nov 25, 2025

The CSV export route ('/export_csv') was non-functional for all modes.

I fixed the export_csv() function to parse through the .pkl files in the session's results folder, filter the detections to those with confidence >= the currently selected threshold, and format it into a CSV.

I think we could simplify it by passing the results directly in the request, but if the export itself is not taking an excessive amount of time, I don't see this as very urgent

Export is working locally on my machine, have not tested inside Docker yet

@tyrwh tyrwh requested a review from nickpalladino November 25, 2025 17:43
rows.append({'Filename': orig_name, 'EggsDetected': count})
for uuid in all_results.keys():
count = sum(1 for d in all_results[uuid] if d['score'] >= threshold)
rows.append({'Filename': filename_map[uuid], 'EggsDetected': count})
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about adding a column for the confidence threshold as well? Seems like it would be good to have that metadata. May be a bit redundant to have in each row since they all with have the same threshold but don't think it's a big deal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's an excellent idea, thanks Nick

@tyrwh tyrwh merged commit d461e2c into main Dec 1, 2025
@tyrwh tyrwh deleted the csv_export branch December 1, 2025 15:58
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