Support gpu.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
from sympy import use
|
||||
from tagger.interrogator import Interrogator, WaifuDiffusionInterrogator
|
||||
from PIL import Image
|
||||
from pathlib import Path
|
||||
@@ -27,6 +29,10 @@ parser.add_argument(
|
||||
'--overwrite',
|
||||
action='store_true',
|
||||
help='Overwrite the file if it exists')
|
||||
parser.add_argument(
|
||||
'--gpu',
|
||||
action='store_true',
|
||||
help='Use GPU (Compatible CUDA and cuDNN required)')
|
||||
parser.add_argument(
|
||||
'--model',
|
||||
default='wd14-convnextv2.v1',
|
||||
@@ -37,6 +43,9 @@ args = parser.parse_args()
|
||||
# get interrogator configs
|
||||
interrogator = interrogators[args.model]
|
||||
|
||||
if args.gpu:
|
||||
interrogator.use_gpu()
|
||||
|
||||
def image_interrogate(image_path: Path):
|
||||
"""
|
||||
Predictions from a image path
|
||||
|
||||
Reference in New Issue
Block a user