Commit 08378ba4 authored by Sikhin VC's avatar Sikhin VC

initial commit

parent 0fc5705a
......@@ -4,4 +4,4 @@ RUN pip install -r /app/requirements.txt
RUN apt-get update && apt-get install tzdata ffmpeg libsm6 libxext6 -y
ADD . /app
WORKDIR /app/
CMD ["python3","main.py"]
\ No newline at end of file
CMD ["python3","app.py"]
\ No newline at end of file
from fastapi import FastAPI
from main import Item
from main import video_rec
app = FastAPI()
@app.post("/items/")
async def create_item(item: Item):
# def video_write(self, frame, unique_id):
# frame_width = int(frame.shape[1])
# frame_height = int(frame.shape[0])
item = item.dict()
video_rec(item)
if __name__ == "__main__":
from uvicorn import run
run(app, host="0.0.0.0", port=2328)
\ No newline at end of file
......@@ -32,7 +32,7 @@ def background(f):
@background
def video_rec(item):
# size = (640, 480)
working_dir = "/home/administrator/aarti_violation_videos"
working_dir = "videos"
file_name = item["name"] + ".webm"
file_name = os.path.join(working_dir, file_name)
......@@ -76,19 +76,4 @@ def video_rec(item):
video.release()
app = FastAPI()
@app.post("/items/")
async def create_item(item: Item):
# def video_write(self, frame, unique_id):
# frame_width = int(frame.shape[1])
# frame_height = int(frame.shape[0])
item = item.dict()
video_rec(item)
if __name__ == "__main__":
from uvicorn import run
run(app, host="192.168.3.181", port=2328)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment