nightfury commited on
Commit
84a7638
1 Parent(s): 53db291

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -8
app.py CHANGED
@@ -111,12 +111,12 @@ 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=[
122
  gr.inputs.Image(label="Input Image", type="pil"),
@@ -135,8 +135,45 @@ interface = gr.Interface(
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"),
@@ -149,10 +186,11 @@ io2 = gr.Interface(
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)
 
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
+ interface1 = gr.Interface(
120
  fn=predict,
121
  inputs=[
122
  gr.inputs.Image(label="Input Image", type="pil"),
 
135
  #examples=[[examples[i]["path"], examples[i]["label"]] for i in range(10)]
136
  )
137
 
138
+ title1 = "AI Generated Image Detection"
139
+ description1 = "~ AI - ML implementation for AI image detection using older models such as VQGAN+CLIP."
140
+ article1 = "<p style='text-align: center'>
141
+ """
142
+ NOTE: To detect pictures generated using older models such as VQGAN+CLIP, please use the updated version of this detector instead.
143
+
144
+ In this model i'm using a ViT model to predict whether an artistic image was generated using AI or not.
145
+
146
+ The training dataset didn't include any samples generated from Midjourney 5, SDXL, or DALLE-3. But was trained on outputs of their predecessors.
147
+
148
+ Scope of this tool is artistic images; that is to say, it is not a deepfake photo detector, and general computer imagery (webcams, screenshots, etc.) may throw it off.
149
+
150
+ The potential indicator for this tool is to serve to detect whether an image was AI-generated or not.
151
+
152
+ Images scoring as very probably artificial (e.g. 90% or higher) could be referred to a human expert for further investigation, if needed.
153
+ Model Trained Using AutoTrain
154
+
155
+ Problem type: Binary Classification
156
+ Model ID: 151965872
157
+ CO2 Emissions (in grams): 7.9405
158
+
159
+ Validation Metrics
160
+
161
+ Loss: 0.163
162
+ Accuracy: 0.942
163
+ Precision: 0.938
164
+ Recall: 0.978
165
+ AUC: 0.980
166
+ F1: 0.958
167
+
168
+ License Notice
169
+
170
+ This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.
171
+
172
+ You may distribute and make this model available to others as part of your own web page, app, or service so long as you provide attribution. However, use of this model within text-to-image systems to evade AI image detection would be considered a "derivative work" and as such prohibited by the license terms.
173
+ """
174
+ </p>"
175
+
176
+ interface1 = gr.Interface(
177
  fn=image_classifier,
178
  inputs=[
179
  gr.inputs.Image(label="Input Image", type="pil"),
 
186
  ],
187
 
188
  theme = gr.themes.Soft(),
189
+ title = title1,
190
+ description = description1,
191
+ article = article1
192
  )
193
+
194
  gr.TabbedInterface(
195
+ [interface1, interface2], ["Deepfake Image Detection", "AI Image Detection"]
196
  ).launch() #share=True)