Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

API functionality for perspective videos #1333

Open susanodd opened 1 month ago

susanodd commented 1 month ago

This can be implemented now. The models are in the master branch.

The only arguments needed by the API are the gloss id, the video, and "left" or "right"

rem0g commented 4 days ago

Is this for Glos Video, NMM video and voorbeeldzinnen? Can I have a link to example API template how to upload left and right video?

susanodd commented 4 days ago

This is for the perspective videos. @Woseseltops wants to do this one. :)

Woseseltops commented 1 day ago

I kinda like the approach where we just add extra parameters to the existing video upload end point. @rem0g , can I get your approval before I implement?

url = 'http://54.93.111.92/dictionary/api_update_gloss/14/video'

# The path to your video file
left_video_file_path = 'left_video.mp4'
right_video_file_path = 'right_video.mp4'

# Auth
headers = {'Authorization': f'Bearer {BEARER_TOKEN}'}

# Open the video file in binary mode and send it in a POST request
files = {'left': open(left_video_file_path, 'rb'), 
         'right': open(right_video_file_path, 'rb')}
response = requests.post(url, files=files, headers=headers)
rem0g commented 1 day ago

Yes, perfect!