vobecant
commited on
Commit
·
ada80e8
1
Parent(s):
88a4add
Initial commit.
Browse files- .idea/workspace.xml +10 -2
- app.py +9 -0
.idea/workspace.xml
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
<project version="4">
|
| 3 |
<component name="ChangeListManager">
|
| 4 |
<list default="true" id="5dd22f22-8223-4d55-99f9-57d1e00622d7" name="Default Changelist" comment="Initial commit.">
|
|
|
|
| 5 |
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
| 6 |
</list>
|
| 7 |
<option name="SHOW_DIALOG" value="false" />
|
|
@@ -50,7 +51,7 @@
|
|
| 50 |
<option name="number" value="Default" />
|
| 51 |
<option name="presentableId" value="Default" />
|
| 52 |
<updated>1647350746642</updated>
|
| 53 |
-
<workItem from="1647350750956" duration="
|
| 54 |
</task>
|
| 55 |
<task id="LOCAL-00001" summary="Initial commit.">
|
| 56 |
<created>1647352693910</created>
|
|
@@ -164,7 +165,14 @@
|
|
| 164 |
<option name="project" value="LOCAL" />
|
| 165 |
<updated>1647357087405</updated>
|
| 166 |
</task>
|
| 167 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
<servers />
|
| 169 |
</component>
|
| 170 |
<component name="TypeScriptGeneratedFilesManager">
|
|
|
|
| 2 |
<project version="4">
|
| 3 |
<component name="ChangeListManager">
|
| 4 |
<list default="true" id="5dd22f22-8223-4d55-99f9-57d1e00622d7" name="Default Changelist" comment="Initial commit.">
|
| 5 |
+
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
| 6 |
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
| 7 |
</list>
|
| 8 |
<option name="SHOW_DIALOG" value="false" />
|
|
|
|
| 51 |
<option name="number" value="Default" />
|
| 52 |
<option name="presentableId" value="Default" />
|
| 53 |
<updated>1647350746642</updated>
|
| 54 |
+
<workItem from="1647350750956" duration="6572000" />
|
| 55 |
</task>
|
| 56 |
<task id="LOCAL-00001" summary="Initial commit.">
|
| 57 |
<created>1647352693910</created>
|
|
|
|
| 165 |
<option name="project" value="LOCAL" />
|
| 166 |
<updated>1647357087405</updated>
|
| 167 |
</task>
|
| 168 |
+
<task id="LOCAL-00017" summary="Initial commit.">
|
| 169 |
+
<created>1647357185506</created>
|
| 170 |
+
<option name="number" value="00017" />
|
| 171 |
+
<option name="presentableId" value="LOCAL-00017" />
|
| 172 |
+
<option name="project" value="LOCAL" />
|
| 173 |
+
<updated>1647357185506</updated>
|
| 174 |
+
</task>
|
| 175 |
+
<option name="localTasksCounter" value="18" />
|
| 176 |
<servers />
|
| 177 |
</component>
|
| 178 |
<component name="TypeScriptGeneratedFilesManager">
|
app.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import requests
|
|
@@ -46,6 +48,13 @@ def download_file_from_google_drive(destination=WEIGHTS):
|
|
| 46 |
save_response_content(response, destination)
|
| 47 |
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
def segment_segmenter(image, model, window_size, window_stride, encoder_features=False, decoder_features=False,
|
| 50 |
no_upsample=False, batch_size=2):
|
| 51 |
seg_pred = utils.inference(
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
import numpy as np
|
| 5 |
import requests
|
|
|
|
| 48 |
save_response_content(response, destination)
|
| 49 |
|
| 50 |
|
| 51 |
+
def download_weights():
|
| 52 |
+
if not os.path.exists(WEIGHTS):
|
| 53 |
+
url = 'https://drive.google.com/file/d/1v6_d2KHzRROsjb_cgxU7jvmnGVDXeBia/view?usp=sharing'
|
| 54 |
+
import urllib.request
|
| 55 |
+
urllib.request.urlretrieve(url, WEIGHTS)
|
| 56 |
+
|
| 57 |
+
|
| 58 |
def segment_segmenter(image, model, window_size, window_stride, encoder_features=False, decoder_features=False,
|
| 59 |
no_upsample=False, batch_size=2):
|
| 60 |
seg_pred = utils.inference(
|