YACWC
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
from typing import Union, Optional, List
|
||||
from pydantic import BaseModel
|
||||
from fastapi import FastAPI, Request, Depends
|
||||
@@ -24,9 +25,9 @@ r = redis.Redis(host='localhost', port=6379, db=15)
|
||||
|
||||
|
||||
class VideosPostRequest(BaseModel):
|
||||
query: str = "A cat and a human",
|
||||
threshold: float = 0.10,
|
||||
c_dirs: Optional[List[str]] = None,
|
||||
query: str = "A cat and a human"
|
||||
threshold: float = 0.10
|
||||
c_dirs: Optional[List[str]] = None
|
||||
task_id: str = 'compute_log'
|
||||
|
||||
@app.post("/videos.json")
|
||||
@@ -61,9 +62,9 @@ async def videos_json(
|
||||
]
|
||||
|
||||
|
||||
print(','.join([str(x) for x in c_dirs]))
|
||||
message = {'task':'SCHEDULED','when':[str(x) for x in c_dirs], 'time':time.time()}
|
||||
r.rpush(task_id, json.dumps(message))
|
||||
# print(','.join([str(x) for x in c_dirs]))
|
||||
# message = {'task':'SCHEDULED','when':[str(x) for x in c_dirs], 'time':time.time()}
|
||||
# r.rpush(task_id, json.dumps(message))?
|
||||
|
||||
|
||||
for x in c_dirs:
|
||||
|
||||
Reference in New Issue
Block a user