Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
htylab committed Jun 15, 2024
1 parent 876ccf6 commit 3957e65
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tigerhx/guitool.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def circular_sector(theta_range, lvb):
return label_mask

def predict_cine4d(input_file, img, model_ff, progress_bar=None, root=None):
xyzt_mode = basename(model_ff).split('_')[1]
xyzt_mode = basename(model_ff).split('_')[2]
session = onnxruntime.InferenceSession(model_ff)
data = img.copy()

Expand Down
31 changes: 30 additions & 1 deletion tigerhx/tigercinegui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from guitool import *
from os.path import join
from os.path import join, isfile
from skimage.transform import resize
from tigerhx import lib_tool

# determine if application is a script file or frozen exe
if getattr(sys, 'frozen', False):
Expand All @@ -20,9 +21,37 @@

model_path = join(application_path, 'models')
output_path = join(application_path, 'output')
os.makedirs(model_path, exist_ok=True)

model_server = 'https://github.com/htylab/tigerhx/releases/download/modelhub/'

default_models = ['cine4d_v0001_xyz_mms12.onnx',
'cine4d_v0002_xyz_mms12acdc.onnx',
'cine4d_v0003_xy_mms12acdc.onnx']

os.makedirs(output_path, exist_ok=True)

for m0 in default_models:

model_file = join(model_path, m0)

if not isfile(model_file):

try:
print(f'Downloading model files....')
model_url = model_server + m0
print(model_url, model_file)
lib_tool.download(model_url, model_file)
download_ok = True
print('Download finished...')
except:
download_ok = False

if not download_ok:
raise ValueError('Server error. Please check the model name or internet connection.')



# Global variables
log_box = None
root = None
Expand Down

0 comments on commit 3957e65

Please sign in to comment.