Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ from huggingface_hub import hf_hub_download
|
|
| 13 |
|
| 14 |
# @title Data retrieval
|
| 15 |
def download_weights():
|
| 16 |
-
hf_hub_download(repo_id="mouseland/cellpose-sam", filename="cpsam")
|
| 17 |
|
| 18 |
#os.system("wget -q https://huggingface.co/mouseland/cellpose-sam/resolve/main/cpsam")
|
| 19 |
|
|
@@ -42,8 +42,8 @@ def download_weights_old():
|
|
| 42 |
fid.write(r.content)
|
| 43 |
|
| 44 |
try:
|
| 45 |
-
download_weights()
|
| 46 |
-
model = models.CellposeModel(gpu=True , pretrained_model=
|
| 47 |
except Exception as e:
|
| 48 |
print(f"Error loading model: {e}")
|
| 49 |
exit(1)
|
|
|
|
| 13 |
|
| 14 |
# @title Data retrieval
|
| 15 |
def download_weights():
|
| 16 |
+
return hf_hub_download(repo_id="mouseland/cellpose-sam", filename="cpsam")
|
| 17 |
|
| 18 |
#os.system("wget -q https://huggingface.co/mouseland/cellpose-sam/resolve/main/cpsam")
|
| 19 |
|
|
|
|
| 42 |
fid.write(r.content)
|
| 43 |
|
| 44 |
try:
|
| 45 |
+
fpath = download_weights()
|
| 46 |
+
model = models.CellposeModel(gpu=True , pretrained_model=fpath)
|
| 47 |
except Exception as e:
|
| 48 |
print(f"Error loading model: {e}")
|
| 49 |
exit(1)
|