File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,20 @@ def model_path(model_type, model_index=0):
58
58
59
59
60
60
def size_model_path (model_type ):
61
- if os .path .exists (model_type ):
62
- return model_type + "_size.npy"
63
- else :
64
- torch_str = "torch"
65
- if model_type == "cyto" or model_type == "nuclei" or model_type == "cyto2" :
66
- basename = "size_%s%s_0.npy" % (model_type , torch_str )
67
- else :
61
+ torch_str = "torch"
62
+ if (model_type == "cyto" or model_type == "nuclei" or
63
+ model_type == "cyto2" or model_type == "cyto3" ):
64
+ if model_type == "cyto3" :
68
65
basename = "size_%s.npy" % model_type
66
+ else :
67
+ basename = "size_%s%s_0.npy" % (model_type , torch_str )
69
68
return cache_model_path (basename )
70
-
69
+ else :
70
+ if os .path .exists (model_type ) and os .path .exists (model_type + "_size.npy" ):
71
+ return model_type + "_size.npy"
72
+ else :
73
+ raise FileNotFoundError (f"size model not found ({ model_type + '_size.npy' } )" )
74
+
71
75
72
76
def cache_model_path (basename ):
73
77
MODEL_DIR .mkdir (parents = True , exist_ok = True )
You can’t perform that action at this time.
0 commit comments