mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-06-10 16:51:23 -05:00
[AI Tagger] Add path mutation (and by extension docker) support (#353)
* add path mutation (and by extension docker) support * update version
This commit is contained in:
@@ -129,6 +129,13 @@ async def tag_scenes():
|
||||
async def __tag_images(images):
|
||||
async with semaphore:
|
||||
imagePaths, imageIds, temp_files = media_handler.get_image_paths_and_ids(images)
|
||||
mutated_image_paths = []
|
||||
for path in imagePaths:
|
||||
mutated_path = path
|
||||
for key, value in config.path_mutation.items():
|
||||
mutated_path = mutated_path.replace(key, value)
|
||||
mutated_image_paths.append(mutated_path)
|
||||
imagePaths = mutated_image_paths
|
||||
try:
|
||||
server_result = await ai_server.process_images_async(imagePaths)
|
||||
if server_result is None:
|
||||
@@ -175,6 +182,10 @@ async def __tag_images(images):
|
||||
async def __tag_scene(scene):
|
||||
async with semaphore:
|
||||
scenePath = scene['files'][0]['path']
|
||||
mutated_path = scenePath
|
||||
for key, value in config.path_mutation.items():
|
||||
mutated_path = mutated_path.replace(key, value)
|
||||
scenePath = mutated_path
|
||||
sceneId = scene['id']
|
||||
log.debug("files result:" + str(scene['files'][0]))
|
||||
phash = scene['files'][0].get('fingerprint', None)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: AI Tagger
|
||||
description: Tag videos and Images with Locally hosted AI using Skier's Patreon AI models
|
||||
version: 1.3
|
||||
version: 1.4
|
||||
url: https://github.com/stashapp/CommunityScripts/tree/main/plugins/AITagger
|
||||
exec:
|
||||
- python
|
||||
|
||||
@@ -13,4 +13,8 @@ ai_base_tag_name = "AI"
|
||||
tagme_tag_name = "AI_TagMe"
|
||||
updateme_tag_name = "AI_UpdateMe"
|
||||
aitagged_tag_name = "AI_Tagged"
|
||||
aierrored_tag_name = "AI_Errored"
|
||||
aierrored_tag_name = "AI_Errored"
|
||||
|
||||
# Example for mutating paths
|
||||
# path_mutation = {"E:": "F:", "G:": "D:"}
|
||||
path_mutation = {}
|
||||
|
||||
Reference in New Issue
Block a user