Spaces:
Sleeping
Sleeping
Jas
#1
by
JasHugF
- opened
- adversarially_trained_model.keras +2 -2
- app.py +3 -2
- requirements.txt +0 -0
adversarially_trained_model.keras
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc920a45ed6a7cc03343f678c72605e979b7e4d25eee8de114a1d760eba74b53
|
| 3 |
+
size 2781926
|
app.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
| 4 |
-
import pandas as pd
|
| 5 |
|
| 6 |
# 1. Load your trained .keras model
|
| 7 |
# This line loads your entire model from the .keras file.
|
| 8 |
model = tf.keras.models.load_model("adversarially_trained_model.keras")
|
| 9 |
print("output_shape:", model.output_shape) # e.g., (None, 5)
|
| 10 |
-
CLASS_NAMES = [
|
|
|
|
| 11 |
|
| 12 |
def preprocess_single_record(record: dict, scaler, df_reference: pd.DataFrame) -> np.ndarray:
|
|
|
|
| 13 |
|
| 14 |
# Convert input dict to DataFrame
|
| 15 |
df_input = pd.DataFrame([record])
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import tensorflow as tf
|
| 3 |
import numpy as np
|
|
|
|
| 4 |
|
| 5 |
# 1. Load your trained .keras model
|
| 6 |
# This line loads your entire model from the .keras file.
|
| 7 |
model = tf.keras.models.load_model("adversarially_trained_model.keras")
|
| 8 |
print("output_shape:", model.output_shape) # e.g., (None, 5)
|
| 9 |
+
CLASS_NAMES = [f'class_{i}' for i in range(23)]# Class names based on the attack mapping from the notebook
|
| 10 |
+
print(CLASS_NAMES)
|
| 11 |
|
| 12 |
def preprocess_single_record(record: dict, scaler, df_reference: pd.DataFrame) -> np.ndarray:
|
| 13 |
+
import pandas as pd
|
| 14 |
|
| 15 |
# Convert input dict to DataFrame
|
| 16 |
df_input = pd.DataFrame([record])
|
requirements.txt
CHANGED
|
Binary files a/requirements.txt and b/requirements.txt differ
|
|
|