Spaces:
Sleeping
Sleeping
Abid
commited on
Commit
·
5f32f95
1
Parent(s):
998456b
DVC added and working webapp with inference
Browse files- app/app_savta.py +8 -8
- requirements.txt +1 -1
app/app_savta.py
CHANGED
|
@@ -11,13 +11,13 @@ PROD_MODEL_PATH = "src/models"
|
|
| 11 |
TRAIN_PATH = "src/data/processed/train/bathroom"
|
| 12 |
TEST_PATH = "src/data/processed/test/bathroom"
|
| 13 |
|
| 14 |
-
if "DYNO" in os.environ and os.path.isdir(".dvc"):
|
| 15 |
-
print("Running DVC")
|
| 16 |
-
os.system("dvc config cache.type copy")
|
| 17 |
-
os.system("dvc config core.no_scm true")
|
| 18 |
-
if os.system(f"dvc pull {PROD_MODEL_PATH} {TRAIN_PATH } {TEST_PATH }") != 0:
|
| 19 |
-
exit("dvc pull failed")
|
| 20 |
-
os.system("rm -r .dvc")
|
| 21 |
# .apt/usr/lib/dvc
|
| 22 |
|
| 23 |
############## Inference ##############################
|
|
@@ -75,7 +75,7 @@ def sepia(input_img):
|
|
| 75 |
def main():
|
| 76 |
iface = gr.Interface(sepia, gr.inputs.Image(shape=(640,480),type='numpy'), "image", title = title, description = description, article = article, examples = examples,theme ="peach",thumbnail=thumbnail)
|
| 77 |
|
| 78 |
-
iface.launch(
|
| 79 |
# enable_queue=True,auth=("admin", "pass1234")
|
| 80 |
|
| 81 |
if __name__ == '__main__':
|
|
|
|
| 11 |
TRAIN_PATH = "src/data/processed/train/bathroom"
|
| 12 |
TEST_PATH = "src/data/processed/test/bathroom"
|
| 13 |
|
| 14 |
+
#if "DYNO" in os.environ and os.path.isdir(".dvc"):
|
| 15 |
+
# print("Running DVC")
|
| 16 |
+
# os.system("dvc config cache.type copy")
|
| 17 |
+
# os.system("dvc config core.no_scm true")
|
| 18 |
+
# if os.system(f"dvc pull {PROD_MODEL_PATH} {TRAIN_PATH } {TEST_PATH }") != 0:
|
| 19 |
+
# exit("dvc pull failed")
|
| 20 |
+
# os.system("rm -r .dvc")
|
| 21 |
# .apt/usr/lib/dvc
|
| 22 |
|
| 23 |
############## Inference ##############################
|
|
|
|
| 75 |
def main():
|
| 76 |
iface = gr.Interface(sepia, gr.inputs.Image(shape=(640,480),type='numpy'), "image", title = title, description = description, article = article, examples = examples,theme ="peach",thumbnail=thumbnail)
|
| 77 |
|
| 78 |
+
iface.launch(enable_queue=True)
|
| 79 |
# enable_queue=True,auth=("admin", "pass1234")
|
| 80 |
|
| 81 |
if __name__ == '__main__':
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 2 |
-
dvc
|
| 3 |
fastai
|
| 4 |
torch==1.10.2+cpu
|
| 5 |
#h5py
|
|
|
|
| 1 |
-f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 2 |
+
#dvc
|
| 3 |
fastai
|
| 4 |
torch==1.10.2+cpu
|
| 5 |
#h5py
|