2👍
You need distributed task queue system like Celery. You can make your application in the way that
You main page (from where execution flow starts)
-
Ask the user to upload a video
-
Save this video file on server
-
Add an entry against video in the database
- Call your detect asynchronous task with id of the video record and save the id of the task returned in the database against video
record - Redirect your user to a success page with video id
On the success page
- Show a success message
- Using javascript call a status web service with video id and update the page (load images dynamically) accordingly again and again until you receive status complete.
In the status web service
-
Get task id using video id
-
Check task status
-
Get images from database using video id (images that your asynchronous task is putting in the database in the background)
-
Return the status (whether completed or in progress) and list of images
Source:stackexchange.com