Spaces:
Sleeping
Sleeping
Abid
commited on
Commit
·
e706d2b
1
Parent(s):
05cd89e
working on the app
Browse files- Notebooks/SavtaDepth_Colab.ipynb +0 -0
- app/app_savta.py +8 -3
Notebooks/SavtaDepth_Colab.ipynb
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
app/app_savta.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import numpy as np
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
title = "SavtaDepth WebApp"
|
|
@@ -12,7 +14,8 @@ examples = [
|
|
| 12 |
]
|
| 13 |
favicon = "examples/favicon.ico"
|
| 14 |
thumbnail = "examples/SavtaDepth.png"
|
| 15 |
-
|
|
|
|
| 16 |
def sepia(input_img):
|
| 17 |
sepia_filter = np.array(
|
| 18 |
[[0.393, 0.769, 0.189], [0.349, 0.686, 0.168], [0.272, 0.534, 0.131]]
|
|
@@ -21,8 +24,10 @@ def sepia(input_img):
|
|
| 21 |
sepia_img /= sepia_img.max()
|
| 22 |
return sepia_img
|
| 23 |
|
|
|
|
|
|
|
| 24 |
def main():
|
| 25 |
-
iface = gr.Interface(sepia, gr.inputs.Image(shape=(
|
| 26 |
|
| 27 |
iface.launch(favicon_path=favicon,auth=("admin", "dagshubsota123"),server_name="0.0.0.0")
|
| 28 |
# enable_queue=True,auth=("admin", "pass1234")
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
+
import torch
|
| 3 |
+
import sys
|
| 4 |
+
from fastai.vision.all import *
|
| 5 |
import gradio as gr
|
| 6 |
|
| 7 |
title = "SavtaDepth WebApp"
|
|
|
|
| 14 |
]
|
| 15 |
favicon = "examples/favicon.ico"
|
| 16 |
thumbnail = "examples/SavtaDepth.png"
|
| 17 |
+
learner = unet_learner(resnet34, path='src/')
|
| 18 |
+
learner.load('model')
|
| 19 |
def sepia(input_img):
|
| 20 |
sepia_filter = np.array(
|
| 21 |
[[0.393, 0.769, 0.189], [0.349, 0.686, 0.168], [0.272, 0.534, 0.131]]
|
|
|
|
| 24 |
sepia_img /= sepia_img.max()
|
| 25 |
return sepia_img
|
| 26 |
|
| 27 |
+
|
| 28 |
+
|
| 29 |
def main():
|
| 30 |
+
iface = gr.Interface(sepia, gr.inputs.Image(shape=(640,480)), "image", title = title, description = description, article = article, examples = examples,theme ="peach",thumbnail=thumbnail)
|
| 31 |
|
| 32 |
iface.launch(favicon_path=favicon,auth=("admin", "dagshubsota123"),server_name="0.0.0.0")
|
| 33 |
# enable_queue=True,auth=("admin", "pass1234")
|