Skip to content

Commit

Permalink
dev(narugo): regenerate doc
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Jan 9, 2024
1 parent a7ea605 commit c2487d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2,310 deletions.
19 changes: 5 additions & 14 deletions docs/source/api_doc/validate/real_benchmark.plot.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import os
import random

from huggingface_hub import HfFileSystem

from benchmark import BaseBenchmark, create_plot_cli
from imgutils.generic.classify import _open_models_for_repo_id
from imgutils.validate import anime_real
from imgutils.validate.real import _REPO_ID

hf_fs = HfFileSystem()

_REPOSITORY = 'deepghs/anime_real_cls'
_MODEL_NAMES = [
os.path.relpath(file, _REPOSITORY).split('/')[0] for file in
hf_fs.glob(f'{_REPOSITORY}/*/model.onnx')
]
_MODEL_NAMES = _open_models_for_repo_id(_REPO_ID).model_names


class AnimeRealBenchmark(BaseBenchmark):
Expand All @@ -21,12 +14,10 @@ def __init__(self, model):
self.model = model

def load(self):
from imgutils.validate.real import _open_anime_real_model
_ = _open_anime_real_model(self.model)
_open_models_for_repo_id(_REPO_ID)._open_model(self.model)

def unload(self):
from imgutils.validate.real import _open_anime_real_model
_open_anime_real_model.cache_clear()
_open_models_for_repo_id(_REPO_ID).clear()

def run(self):
image_file = random.choice(self.all_images)
Expand Down
Loading

0 comments on commit c2487d9

Please sign in to comment.