AZIIIIIIIIZ commited on
Commit
215a903
1 Parent(s): c110d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -1,19 +1,19 @@
1
-
2
- import gradio as gr
3
- from transformers import pipeline
4
-
5
- pipeline = pipeline("image-classification", model="AZIIIIIIIIZ/vit-base-patch16-224-finetuned-eurosat")
6
-
7
- def predict(input_img):
8
- predictions = pipeline(input_img)
9
- return input_img, {p["label"]: p["score"] for p in predictions}
10
-
11
- gradio_app = gr.Interface(
12
- predict,
13
- inputs=gr.Image(label="Select Image", sources=['upload', 'webcam'], type="pil"),
14
- outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
15
- title="AI Generated? Or Not?",
16
- )
17
-
18
- if __name__ == "__main__":
19
  gradio_app.launch()
 
1
+
2
+ import gradio as gr
3
+ from transformers import pipeline
4
+
5
+ pipeline = pipeline("image-classification", model="AZIIIIIIIIZ/swin-tiny-patch4-window7-224-finetuned-eurosat")
6
+
7
+ def predict(input_img):
8
+ predictions = pipeline(input_img)
9
+ return input_img, {p["label"]: p["score"] for p in predictions}
10
+
11
+ gradio_app = gr.Interface(
12
+ predict,
13
+ inputs=gr.Image(label="Select Image", sources=['upload', 'webcam'], type="pil"),
14
+ outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
15
+ title="AI Generated? Or Not?",
16
+ )
17
+
18
+ if __name__ == "__main__":
19
  gradio_app.launch()