Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,7 @@ import functools
|
|
20 |
|
21 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
22 |
|
23 |
-
|
24 |
-
# Helper Functions
|
25 |
-
# ============================
|
26 |
|
27 |
def add_time_decimal_feature(df):
|
28 |
"""
|
@@ -274,9 +272,6 @@ def load_scalers(scaler_paths):
|
|
274 |
raise FileNotFoundError(f"Scaler file for {model_name} not found at '{scaler_path}'. Please provide the correct path.")
|
275 |
return loaded_scalers
|
276 |
|
277 |
-
# ============================
|
278 |
-
# Model Selection Logic
|
279 |
-
# ============================
|
280 |
|
281 |
def determine_subarea(df):
|
282 |
"""
|
@@ -471,7 +466,7 @@ def classical_prediction(file_path, model_choice, min_mmsi, max_mmsi, models, lo
|
|
471 |
|
472 |
logging.info("Input CSV has the correct columns.")
|
473 |
|
474 |
-
|
475 |
if selected_model_name != 'Cargo_Vessel':
|
476 |
df = add_time_decimal_feature(df)
|
477 |
else:
|
@@ -517,7 +512,7 @@ def classical_prediction(file_path, model_choice, min_mmsi, max_mmsi, models, lo
|
|
517 |
all_predictions.append(predictions)
|
518 |
all_y_true.append(y_batch.numpy())
|
519 |
|
520 |
-
inference_time = time.time() - start_time # End inference time
|
521 |
|
522 |
all_predictions = np.concatenate(all_predictions, axis=0)
|
523 |
y_true = np.concatenate(all_y_true, axis=0)
|
|
|
20 |
|
21 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
22 |
|
23 |
+
|
|
|
|
|
24 |
|
25 |
def add_time_decimal_feature(df):
|
26 |
"""
|
|
|
272 |
raise FileNotFoundError(f"Scaler file for {model_name} not found at '{scaler_path}'. Please provide the correct path.")
|
273 |
return loaded_scalers
|
274 |
|
|
|
|
|
|
|
275 |
|
276 |
def determine_subarea(df):
|
277 |
"""
|
|
|
466 |
|
467 |
logging.info("Input CSV has the correct columns.")
|
468 |
|
469 |
+
|
470 |
if selected_model_name != 'Cargo_Vessel':
|
471 |
df = add_time_decimal_feature(df)
|
472 |
else:
|
|
|
512 |
all_predictions.append(predictions)
|
513 |
all_y_true.append(y_batch.numpy())
|
514 |
|
515 |
+
inference_time = time.time() - start_time # End inference time
|
516 |
|
517 |
all_predictions = np.concatenate(all_predictions, axis=0)
|
518 |
y_true = np.concatenate(all_y_true, axis=0)
|