Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Docs #1

Open
rickyyx opened this issue Jul 11, 2020 · 1 comment
Open

API Docs #1

rickyyx opened this issue Jul 11, 2020 · 1 comment

Comments

@rickyyx
Copy link
Member

rickyyx commented Jul 11, 2020

API

Key Frame Shots Segment Component (Vicky)

Take in a long video, outputs segmented shots. Sample output:

{
    "features": {
        # Timestamps when each shot started
        "timestamps": [0.0, 1.0, 3, 4],

        # For each shot, also output a list of keyframes frame number (If possible)
        # It can be in different formats that is easy for you to generate:
        #  - These can be the raw frame image paths, e.g. 'xxx.png'
        #  - Eact timestamps of the frame in the video, e.g. '13.3'
        "frames": [
                [0],
                [40, 90, 100],
                [123, 300, 900],
                [1300, 1400],
        ],
    },
    # ABSOLUTE path to the video
    "video_name": "/tmp/data/easytopic/XXXXX.mp4"
}
@rickyyx
Copy link
Member Author

rickyyx commented Jul 13, 2020

Server - Web REST API

Uploading video

This might have to use socket.IO for streaming data between the website and the server.

Request:

URL: /upload
METHOD: POST
DATA: <raw video> 

Response

- id: int
- remaining process time : float
- current state : string
- logs : dict # TODO: What to put in the logs?

    + video specific info:
      - size of video 
      - length of video 
      - number of shots after preprocess

    + model specific information
      - loss
      - test evaluated metrics 

Canceling upload (optional):

Request:

URL: /cancel-upload
FIELD: 
  - id # Get from the previous upload request 

Response:

- success 

Showing segment results

There are multiple ways to do this:

  1. if using socket IO, once the socket closes, the final segment results can be passed
  2. there could be another REST API: /result?id=xxxx

Response:

- segments
   - outline 
   - timestamp 
   - keywords 
   - confidence score? 

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

No branches or pull requests

1 participant