mirror of
https://github.com/ClovertaTheTrilobita/cellpose-web.git
synced 2026-04-01 23:14:50 +00:00
feature(config): 新增模型自定义路径
This commit is contained in:
parent
04e2bf0edc
commit
98351dc096
2 changed files with 9 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
model:
|
model:
|
||||||
|
save_dir: models
|
||||||
|
|
||||||
data:
|
data:
|
||||||
root_dir: .
|
root_dir: .
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
from cellpose import models, plot
|
import os
|
||||||
from cellpose.io import imread, save_masks
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import os, datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -14,6 +13,12 @@ BASE_DIR = cfg.data.root_dir
|
||||||
UPLOAD_DIR = cfg.data.upload_dir
|
UPLOAD_DIR = cfg.data.upload_dir
|
||||||
OUTPUT_DIR = cfg.data.run.output_dir
|
OUTPUT_DIR = cfg.data.run.output_dir
|
||||||
OUTPUT_TEST_DIR = cfg.data.run.test_output_dir
|
OUTPUT_TEST_DIR = cfg.data.run.test_output_dir
|
||||||
|
MODELS_DIR = str((CONFIG_PATH.parent / cfg.model.save_dir).resolve())
|
||||||
|
os.makedirs(MODELS_DIR, exist_ok=True)
|
||||||
|
os.environ["CELLPOSE_LOCAL_MODELS_PATH"] = MODELS_DIR
|
||||||
|
|
||||||
|
from cellpose import models, plot
|
||||||
|
from cellpose.io import imread, save_masks
|
||||||
|
|
||||||
class Cprun:
|
class Cprun:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue