tnc-ca-geo / animl-api

Backend for https://animl.camera
Other
4 stars 0 forks source link

Tighten up UX if user uploads a batch without any automation rules set #114

Open nathanielrindlaub opened 1 year ago

nathanielrindlaub commented 1 year ago

If a user uploads a batch to their project but doesn't have any ML-related automation rules currently set (and by default that is the case w/ new Projects), the queues get spun up and querying the batch will return batch.remaining: 0 until (I'm guessing??) the scheduled ingest-delete gets run and cleans it up. From the users' perspective this may be confusing as it will look like the image processing has hung.

@ingalls - any ideas for a cleaner fix for this? I put a band-aid on it by checking whether or not a user's project has automation rules set when they click "upload", and if not, an alert pops up that says:

<p>There are currently no machine learning automation rules 
      configured to trigger when new images are added to this Project, so if you proceed, images in  
      this ZIP will be saved, but the upload will not produce in any machine learning predictions. To learn more 
      about how to configure machine learning pipelines using Automation Rules, 
      please refer to the <a href="https://docs.animl.camera" target='_blank' rel='noopener noreferrer'>Animl Documentation</a>.
    </p>

And forces them to click "upload anyway" to continue, but it's not a perfect solution and the user experience will still be confusing if they do proceed.

ingalls commented 1 year ago

@nathanielrindlaub Two Immediate Thoughts:

nathanielrindlaub commented 1 year ago

@ingalls ok cool - I'm not sure we want to disallow users from uploading images w/o automation rules set because there's a chance someone would not want and ML predictions at all. I think what I'm looking for is suggestions for how we might support that use-case (while making sure users understand the implications before initiating an upload), rather than prevent it.

It seems like we'd probably need to figure out how to make ingest-zip aware that there are no automation rules, and not to create the processing stack if so. Perhaps this could be accomplished by somehow passing that info in from the frontend during createUpload - not sure.

We'd also likely need to update how we handle getBatches and display the status on the frontend, as batch.remaining and probably some other batch fields would no longer be relevant.

That said I think this is low priority for now so I think I'll kick it to a future milestone.