cmckinle commited on
Commit
fc9c6c5
·
verified ·
1 Parent(s): 9e66888

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -85,7 +85,7 @@ def process_files(ai_files, real_files):
85
 
86
  def evaluate_model(temp_dir):
87
  labels, preds, images = [], [], []
88
- false_positives, false_negatives = [], []
89
  detector = AIDetector()
90
 
91
  total_images = sum(len(files) for _, _, files in os.walk(temp_dir))
@@ -232,7 +232,6 @@ def generate_pdf(accuracy, roc_score, report_html, confusion_matrix_plot):
232
  buffer.seek(0)
233
  return buffer
234
 
235
-
236
  def load_url(url):
237
  try:
238
  urllib.request.urlretrieve(url, "temp_image.png")
@@ -261,9 +260,10 @@ def create_gradio_interface():
261
 
262
  with gr.Group():
263
  with gr.Box():
264
- gr.HTML(
265
- """<b>Model: Newhouse AI Image Detection Model v1.1</b><br>
266
- <i>This model has been trained on flux dev, flux schnell, Stable Diffusion 1.2, SDXL, and 3.5. The changes from 1.0 are that the model has had additional fine tuning on solid background images</i>"""
 
267
  )
268
  output_html = gr.HTML()
269
  output_label = gr.Label(label="Output")
@@ -292,7 +292,11 @@ def create_gradio_interface():
292
  individual_process_btn = gr.Button("Process Individual Files", interactive=False)
293
 
294
  with gr.Group():
295
- gr.Markdown(f"### Newhouse AI Image Detection Model v1.0")
 
 
 
 
296
  output_acc = gr.Label(label="Accuracy")
297
  output_roc = gr.Label(label="ROC Score")
298
  output_report = gr.HTML(label="Classification Report")
@@ -371,4 +375,4 @@ if __name__ == "__main__":
371
  show_api=False,
372
  max_threads=24,
373
  show_error=True
374
- )
 
85
 
86
  def evaluate_model(temp_dir):
87
  labels, preds, images = [], [], []
88
+ false_positives, false_negatives = []
89
  detector = AIDetector()
90
 
91
  total_images = sum(len(files) for _, _, files in os.walk(temp_dir))
 
232
  buffer.seek(0)
233
  return buffer
234
 
 
235
  def load_url(url):
236
  try:
237
  urllib.request.urlretrieve(url, "temp_image.png")
 
260
 
261
  with gr.Group():
262
  with gr.Box():
263
+ # Add your note here about training:
264
+ gr.HTML(
265
+ """<b>Model: Newhouse AI Image Detection Model v1.0</b><br>
266
+ <i>This model has been trained on flux dev, flux schnell, Stable Diffusion 1.2, SDXL, and 3.5.</i>"""
267
  )
268
  output_html = gr.HTML()
269
  output_label = gr.Label(label="Output")
 
292
  individual_process_btn = gr.Button("Process Individual Files", interactive=False)
293
 
294
  with gr.Group():
295
+ # Add the same or similar note here if you want it repeated:
296
+ gr.Markdown(
297
+ """### Newhouse AI Image Detection Model v1.0
298
+ **This model has been trained on flux dev, flux schnell, Stable Diffusion 1.2, SDXL, and 3.5.**"""
299
+ )
300
  output_acc = gr.Label(label="Accuracy")
301
  output_roc = gr.Label(label="ROC Score")
302
  output_report = gr.HTML(label="Classification Report")
 
375
  show_api=False,
376
  max_threads=24,
377
  show_error=True
378
+ )