Upload 2 files
Browse files- app.py +20 -0
- requirements.txt +7 -0
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def image_mod(image):
|
| 6 |
+
return image.rotate(45)
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
demo = gr.Interface(
|
| 10 |
+
image_mod,
|
| 11 |
+
gr.Image(type="pil"),
|
| 12 |
+
"image",
|
| 13 |
+
examples=[
|
| 14 |
+
os.path.join(os.path.dirname(__file__), "images/sample1.jpg"),
|
| 15 |
+
os.path.join(os.path.dirname(__file__), "images/sample2.jpg"),
|
| 16 |
+
],
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
if __name__ == "__main__":
|
| 20 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
--index-url https://download.pytorch.org/whl/cpu
|
| 2 |
+
torch==2.0.1
|
| 3 |
+
torchvision==0.15.2
|
| 4 |
+
numpy==1.25.2
|
| 5 |
+
opencv-python==4.8.0.76
|
| 6 |
+
transformers==4.22.1
|
| 7 |
+
Pillow==9.3.0
|