Yash goyal commited on
Update app.py
Browse files237 unmodified lines23823924024124224324424 unmodified lines269270271272273274275276237 unmodified lines@app.route("/uploads/<filename>")def uploaded_file(filename):return send_file(os.path.join("static/uploads", filename))@app.route("/predict", methods=["POST"])def predict():24 unmodified linestimestamp = datetime.now().strftime("%Y%m%d%H%M%S")image_filename = f"scan_{user.id}_{timestamp}.jpg"image_path = os.path.join("static/uploads", image_filename)os.makedirs("static/uploads", exist_ok=True)with open(image_path, "wb") as f:f.write(image_bytes)237 unmodified lines23823924024124224324424524 unmodified lines270271272273274275276277278237 unmodified lines@app.route("/uploads/<filename>")def uploaded_file(filename):upload_folder = "/tmp/uploads"return send_file(os.path.join(upload_folder, filename))@app.route("/predict", methods=["POST"])def predict():24 unmodified linestimestamp = datetime.now().strftime("%Y%m%d%H%M%S")image_filename = f"scan_{user.id}_{timestamp}.jpg"upload_folder = "/tmp/uploads"image_path = os.path.join(upload_folder, image_filename)os.makedirs(upload_folder, exist_ok=True)with open(image_path, "wb") as f:f.write(image_bytes)
app.py+5-3