Teched-U / video-seg

Model for video segmentation and semantic summary extraction
1 stars 0 forks source link

API Docs #1

Open rickyyx opened 4 years ago

rickyyx commented 4 years ago

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 commented 4 years ago

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?