File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ def install(package):
4040 except ModuleNotFoundError :
4141 install ('pydantic' )
4242 toRaise = True
43+
44+ try :
45+ import cv2
46+ except ModuleNotFoundError :
47+ install ('opencv-python' )
48+ toRaise = True
4349
4450 if toRaise :
4551 raise Exception ("Installed required packages, please retry the task." )
@@ -53,11 +59,6 @@ def install(package):
5359 import ai_server
5460 import utility
5561 from datetime import datetime
56- try :
57- import cv2
58- except ModuleNotFoundError :
59- install ('opencv-python' )
60- toRaise = True
6162except :
6263 log .error ("Attempted to install required packages, please retry the task." )
6364 log .error (f"Stack trace { traceback .format_exc ()} " )
@@ -238,7 +239,7 @@ async def __tag_images(images):
238239 else :
239240 tags_list = []
240241 for _ , tags in result .items ():
241- stashtag_ids = media_handler .get_tag_ids (tags )
242+ stashtag_ids = media_handler .get_tag_ids (tags , create = True )
242243 stashtag_ids .append (media_handler .ai_tagged_tag_id )
243244 tags_list .extend (stashtag_ids )
244245 media_handler .add_tags_to_image (id , tags_list )
@@ -375,4 +376,4 @@ def increment_progress():
375376 global increment
376377 progress += increment
377378 log .progress (progress )
378- asyncio .run (main ())
379+ asyncio .run (main ())
Original file line number Diff line number Diff line change 11name : AI Tagger
22description : Tag videos and Images with Locally hosted AI using Skier's Free and Patreon AI models
3- version : 2.0
3+ version : 2.1
44url : https://github.com/stashapp/CommunityScripts/tree/main/plugins/AITagger
55exec :
66 - python
You can’t perform that action at this time.
0 commit comments