Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/routes/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import csv
import math
import numpy as np

import uuid
from pathlib import Path
import os
import pandas as pd
Expand All @@ -24,6 +24,7 @@


# Constants

ALLOWED_EXTENSIONS = {"txt", "webm"}
COLLECTION_NAME = "session"

Expand Down Expand Up @@ -163,7 +164,7 @@ def batch_predict():

base_path = Path().absolute() / "app/services/calib_validation/csv/data"
calib_csv_path = base_path / f"{calib_id}_fixed_train_data.csv"
predict_csv_path = base_path / "temp_batch_predict.csv"
predict_csv_path = base_path / f"temp_batch_predict_{uuid.uuid4().hex}.csv"

# CSV temporário
with open(predict_csv_path, "w", newline="") as csvfile:
Expand All @@ -188,7 +189,8 @@ def batch_predict():
screen_width=screen_width,
screen_height=screen_height,
)

os.remove(predict_csv_path)

return jsonify(convert_nan_to_none(result))

except Exception as e:
Expand Down
Loading