Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -5,13 +5,13 @@ import torch
|
|
5 |
|
6 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/elon.jpg', 'elon.png')
|
7 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/pentagon.jpg', 'pentagon.jpg')
|
8 |
-
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/split.jpg', 'split.jpg')
|
9 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/horns.jpg', 'horns.jpg')
|
10 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/waves.png', 'waves.jpg')
|
|
|
11 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/australia.jpg', 'australia.jpg')
|
12 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/yeti.jpeg', 'yeti.jpg')
|
13 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/pollock.jpg', 'pollock.jpg')
|
14 |
-
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/
|
15 |
|
16 |
blip_processor_large = AutoProcessor.from_pretrained("umm-maybe/image-generator-identifier")
|
17 |
blip_model_large = BlipForConditionalGeneration.from_pretrained("umm-maybe/image-generator-identifier")
|
@@ -38,10 +38,10 @@ def generate_captions(image):
|
|
38 |
|
39 |
|
40 |
|
41 |
-
examples = [["elon.jpg"], ["pentagon.jpg"], ["
|
42 |
|
43 |
title = "Generator Identification via Image Captioning"
|
44 |
-
description = "Gradio Demo to illustrate the use of a fine-tuned BLIP image captioning to identify synthetic images. To use it, simply upload your image and click 'submit', or click one of the examples to load them."
|
45 |
|
46 |
interface = gr.Interface(fn=generate_captions,
|
47 |
inputs="image",
|
|
|
5 |
|
6 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/elon.jpg', 'elon.png')
|
7 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/pentagon.jpg', 'pentagon.jpg')
|
|
|
8 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/horns.jpg', 'horns.jpg')
|
9 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/waves.png', 'waves.jpg')
|
10 |
+
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/radcliffe.jpg', 'radcliffe.jpg')
|
11 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/australia.jpg', 'australia.jpg')
|
12 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/yeti.jpeg', 'yeti.jpg')
|
13 |
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/pollock.jpg', 'pollock.jpg')
|
14 |
+
torch.hub.download_url_to_file('https://static01.nytimes.com/newsgraphics/2023-06-08-disinfo-ai-detector/7343d4ca746b7965141e230d94dd4f5f564f2bfb/_assets/man.png', 'man.png')
|
15 |
|
16 |
blip_processor_large = AutoProcessor.from_pretrained("umm-maybe/image-generator-identifier")
|
17 |
blip_model_large = BlipForConditionalGeneration.from_pretrained("umm-maybe/image-generator-identifier")
|
|
|
38 |
|
39 |
|
40 |
|
41 |
+
examples = [["elon.jpg"], ["pentagon.jpg"], ["horns.jpg"], ["waves.jpg"], ["radcliffe.jpg"], ["australia.jpg"], ["yeti.jpg"], ["pollock.jpg"], ["man.png"]]
|
42 |
|
43 |
title = "Generator Identification via Image Captioning"
|
44 |
+
description = "Gradio Demo to illustrate the use of a fine-tuned BLIP image captioning model to identify synthetic images. To use it, simply upload your image and click 'submit', or click one of the examples to load them."
|
45 |
|
46 |
interface = gr.Interface(fn=generate_captions,
|
47 |
inputs="image",
|