nightfury commited on
Commit
53db291
·
verified ·
1 Parent(s): 9844682

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -107,13 +107,15 @@ def predict(input_image:Image.Image, true_label:str):
107
  }
108
  return confidences, true_label, face_with_mask
109
 
110
- title = "Deepfake Image Detection & AI Art Detector"
111
  description = "~ AI - ML implementation for fake and real image detection..."
112
  article = "<p style='text-align: center'>...</p>"
113
 
114
- #demo = gr.Interface(fn=image_classifier, inputs=gr.Image(type="pil"), outputs="label", title=title, description=description)
115
  #demo.launch(show_api=False)
116
 
 
 
117
  interface = gr.Interface(
118
  fn=predict,
119
  inputs=[
@@ -126,7 +128,15 @@ interface = gr.Interface(
126
  gr.outputs.Image(label="Face with Explainability", type="pil")
127
  #ValueError: Invalid value for parameter `type`: auto. Please choose from one of: ['numpy', 'pil', 'filepath']
128
  ],
 
 
 
 
 
 
129
 
 
 
130
  fn=image_classifier,
131
  inputs=[
132
  gr.inputs.Image(label="Input Image", type="pil"),
@@ -138,10 +148,11 @@ interface = gr.Interface(
138
  #ValueError: Invalid value for parameter `type`: auto. Please choose from one of: ['numpy', 'pil', 'filepath']
139
  ],
140
 
141
-
142
  theme = gr.themes.Soft(),
143
- title = title,
144
  description = description,
145
- article = article
146
- #examples=[[examples[i]["path"], examples[i]["label"]] for i in range(10)]
 
 
147
  ).launch() #share=True)
 
107
  }
108
  return confidences, true_label, face_with_mask
109
 
110
+ title = "Deepfake Image Detection"
111
  description = "~ AI - ML implementation for fake and real image detection..."
112
  article = "<p style='text-align: center'>...</p>"
113
 
114
+ demo = gr.Interface(fn=image_classifier, inputs=gr.Image(type="pil"), outputs="label", title=title, description=description)
115
  #demo.launch(show_api=False)
116
 
117
+ #interface
118
+
119
  interface = gr.Interface(
120
  fn=predict,
121
  inputs=[
 
128
  gr.outputs.Image(label="Face with Explainability", type="pil")
129
  #ValueError: Invalid value for parameter `type`: auto. Please choose from one of: ['numpy', 'pil', 'filepath']
130
  ],
131
+ theme = gr.themes.Soft(),
132
+ title = title,
133
+ description = description,
134
+ article = article
135
+ #examples=[[examples[i]["path"], examples[i]["label"]] for i in range(10)]
136
+ )
137
 
138
+ '''
139
+ io2 = gr.Interface(
140
  fn=image_classifier,
141
  inputs=[
142
  gr.inputs.Image(label="Input Image", type="pil"),
 
148
  #ValueError: Invalid value for parameter `type`: auto. Please choose from one of: ['numpy', 'pil', 'filepath']
149
  ],
150
 
 
151
  theme = gr.themes.Soft(),
152
+ title = "AI Art Detector",
153
  description = description,
154
+ )
155
+ '''
156
+ gr.TabbedInterface(
157
+ [interface, demo], ["Deepfake Image Detection", "AI ART Detection"]
158
  ).launch() #share=True)