narainp commited on
Commit
83e3290
·
verified ·
1 Parent(s): 200fb6b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -2
app.py CHANGED
@@ -79,11 +79,34 @@ def predict_image(path):
79
  y_pred = 1 - nn.functional.softmax(pred, dim=1).data.cpu().numpy()[:, 0]
80
  return float(y_pred.item())
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  iface = gr.Interface(
83
  fn=predict_image,
84
- inputs=gr.Image(type="filepath"),
 
 
 
85
  outputs="number",
86
- title="Image Prediction App",
87
  description="Upload an image and get a model prediction."
88
  )
89
 
 
79
  y_pred = 1 - nn.functional.softmax(pred, dim=1).data.cpu().numpy()[:, 0]
80
  return float(y_pred.item())
81
 
82
+ instructions = """
83
+
84
+ # Understanding Steganalysis
85
+
86
+ Steganalysis is the process of detecting hidden messages or data embedded within digital media, such as images, audio, or video files. Unlike cryptography, which conceals the content, steganography hides the existence of the message itself. Steganalysis methods aim to uncover these concealed messages by analyzing statistical anomalies or patterns.
87
+
88
+ ### Instructions for Using the Steganalysis Detector
89
+
90
+ * **Image Size**: The model is trained specifically for 512x512 images. Uploading images of different sizes may lead to inaccurate predictions.
91
+ * **JPEG Format**: This model is optimized for JPEG images. Other formats may introduce artifacts that affect detection accuracy.
92
+ * **Image Quality**: Compressed, resized, or heavily edited images may have distortions that interfere with proper analysis.
93
+
94
+ ### When the Detector Fails
95
+
96
+ * **Incorrect Image Size**: If the image is not 512x512, resizing artifacts can degrade performance.
97
+ * **Unsupported Formats**: PNG, BMP, and other formats might introduce noise that misleads the model.
98
+ * **Low-Quality JPEGs**: Excessive compression or alterations may erase hidden information, making detection difficult.
99
+
100
+ """
101
+
102
  iface = gr.Interface(
103
  fn=predict_image,
104
+ inputs=[
105
+ gr.Image(type="filepath"),
106
+ gr.Textbox(value=instructions, interactive=False, label="instructions"),
107
+ ],
108
  outputs="number",
109
+ title="Steganalysis Prediction App",
110
  description="Upload an image and get a model prediction."
111
  )
112