Posting a video to the server
URL # hosted server URL
POST request -> URL/api/video
request.files['file'] <- should contain video as a file
request.form['category'] <- should contain category name
Quering an Image to the server
URL # hosted server URL
POST request -> URL/api/query
# e.g. request
response = requests.get(URL/api/query, data=open(image.png, 'rb'))
response['category'] <- is the required category (for e.g. jug, teapot, phone or other object name)
db = Database()
db.store_video_in_frames(video_file_path, category_name)
db.update_database_with_new_features()
What it does?
- Saves the video file
- Breaks it into frames and store in database
- Extracts the feature and saves in the stored-feature compressed file as per VGG model histogram output
- Consider this as Script ML Model Training on unseen data
db = Database()
category = query(image_to_be_queries.jpg, db)
print(category) <- this will print objects name (e.g. jug, teapot, cat)
What it does?
- Saves the image
- Takes the stored-features database into the memory
- Queries with the image
- Returns the most likely object's name
requirements.txt
: Use it to install python libraries aspip install -r requirements.txt
run.py
: contains main model for extraction of features and running scriptwebapp.py
: Handles API call and demostrative flask web-appmodel.py
: Contains main ML VGG modelevaluation.py
: Evaluates the query and inferes as per metricsconfig.py
: Contains all relative paths and configurationvideos
: Stores all uploaded videostemplates
: templates for web applicationqueryimages
: Saves all images that are querieddatabase
: Contains metadata CSVs and all frames of images and the store-features ML trained model