Add cpu only option instead of gpu option.
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
from sympy import use
|
||||
from tagger.interrogator import Interrogator, WaifuDiffusionInterrogator
|
||||
from PIL import Image
|
||||
from pathlib import Path
|
||||
@@ -30,9 +25,9 @@ parser.add_argument(
|
||||
action='store_true',
|
||||
help='Overwrite the file if it exists')
|
||||
parser.add_argument(
|
||||
'--gpu',
|
||||
'--cpu',
|
||||
action='store_true',
|
||||
help='Use GPU (Compatible CUDA and cuDNN required)')
|
||||
help='Use CPU only')
|
||||
parser.add_argument(
|
||||
'--model',
|
||||
default='wd14-convnextv2.v1',
|
||||
@@ -43,8 +38,8 @@ args = parser.parse_args()
|
||||
# get interrogator configs
|
||||
interrogator = interrogators[args.model]
|
||||
|
||||
if args.gpu:
|
||||
interrogator.use_gpu()
|
||||
if args.cpu:
|
||||
interrogator.use_cpu()
|
||||
|
||||
def image_interrogate(image_path: Path):
|
||||
"""
|
||||
@@ -72,7 +67,7 @@ if args.dir:
|
||||
tags = image_interrogate(image_path)
|
||||
tags_str = ", ".join(tags.keys())
|
||||
|
||||
with open(caption_path, "w") as fp:
|
||||
with open(caption_path, 'w') as fp:
|
||||
fp.write(tags_str)
|
||||
|
||||
if args.file:
|
||||
|
||||
Reference in New Issue
Block a user