check mmdet on startup

pull/2/head v23.4.1
Bingsu 2023-04-08 12:39:06 +09:00
parent 0ab961fd94
commit 9b415e2b47
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "dddetailer"
version = "23.4.0"
version = "23.4.1"
description = "An object detection and auto-mask extension for Stable Diffusion web UI."
authors = [
{name = "dowon", email = "ks2515@naver.com"},

View File

@ -56,6 +56,12 @@ def list_models(model_path):
def startup():
from launch import is_installed, run, python
if not is_installed("mmdet"):
run(f'"{python}" -m pip install openmim', desc="Installing openmim", errdesc="Couldn't install openmim")
run(f'"{python}" -m mim install mmcv>=2.0.0 mmdet>=3.0.0', desc="Installing mmdet", errdesc="Couldn't install mmdet")
if len(list_models(dd_models_path)) == 0:
print("No detection models found, downloading...")
bbox_path = os.path.join(dd_models_path, "bbox")