File size: 531 Bytes
85e524b f8cd92f 85e524b f8cd92f 85e524b f8cd92f 0b72274 f8cd92f 85e524b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from flask import Flask, request, jsonify
from summarize import Vid2Sum
app = Flask(__name__)
@app.route('/predict', methods=['POST'])
def predict():
# Check if video file is included in the request
if 'video' not in request.files:
return jsonify({'error': 'No video file found'}), 400
video_file = request.files['video']
# Perform video-to-text conversion using your existing code
text_output = Vid2Sum(video_file)
return jsonify({'text': text_output})
if __name__ == '__main__':
app.run()
|