-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.py
30 lines (23 loc) · 783 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from flask import Flask, request, jsonify
import os
from dotenv import load_dotenv
import sys
from models.video_cropper import save_img_range
from models.video_analyzer import analyze_video, encode_image
load_dotenv()
app = Flask(__name__)
@app.route('/')
def home():
return "Welcome to the Video Processing API!"
@app.route('/analyze_video', methods=['POST'])
def analyze_video_route():
video_path = request.form.get('video_path')
if not video_path:
return jsonify({"error": "No video path provided"}), 400
# Add your video analysis logic here
# For example:
# result = analyze_video(video_path)
# return jsonify(result)
return jsonify({"message": "Video analysis started"}), 200
if __name__ == "__main__":
app.run(debug=True)