8 Commits
9 changed files with 170 additions and 3810 deletions
-1
View File
@@ -1 +0,0 @@
CLIPDROP_API_KEY=
+168 -460
View File
@@ -1,5 +1,5 @@
# v1.1.0
import cv2, json, os, math, pathlib, requests, io
import cv2, json, os, math
import numpy as np
import torch
import hashlib
@@ -7,79 +7,6 @@ import comfy.model_management as model_management
import folder_paths
from PIL import Image, ImageOps
from transformers import AutoProcessor
from transformers import OneFormerForUniversalSegmentation
from transformers import OneFormerProcessor
def from_torch_image(image):
image = image.squeeze().cpu().numpy() * 255.0
image = np.clip(image, 0, 255).astype(np.uint8)
return image
def to_torch_image(image):
image = image.astype(dtype=np.float32)
image /= 255.0
image = torch.from_numpy(image)[
None,
]
image = image.unsqueeze(0)
return image
def get_bounding_box(mask_input):
rows = np.any(mask_input, axis=1)
cols = np.any(mask_input, axis=0)
rmin, rmax = np.where(rows)[0][[0, -1]]
cmin, cmax = np.where(cols)[0][[0, -1]]
return rmin, cmin, rmax, cmax
def extract_box_from_image(image, mask):
y_min, x_min, y_max, x_max = get_bounding_box(mask_input=mask)
return image[y_min:y_max + 1, x_min:x_max + 1, :]
def stitch_back_box_to_image(image_original, mask_original, image_patch):
y_min, x_min, y_max, x_max = get_bounding_box(mask_input=mask_original)
image_original[y_min:y_max + 1, x_min:x_max + 1] = image_patch
return image_original
def do_work(image, external_file_name):
exec(open(external_file_name, 'r').read())
return image
def do_work_with_mask(image, mask, external_file_name):
exec(open(external_file_name, 'r').read())
return image
def get_segmentation_of_person(image):
NAME_MODEL_ONEFORMER = 'shi-labs/oneformer_ade20k_dinat_large'
processor = OneFormerProcessor.from_pretrained(NAME_MODEL_ONEFORMER)
model = OneFormerForUniversalSegmentation.from_pretrained(
NAME_MODEL_ONEFORMER)
width = image.shape[1]
height = image.shape[0]
inputs = processor(image, ["semantic"], return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predicted_semantic_map = processor.post_process_semantic_segmentation(
outputs, target_sizes=[(height, width)])[0]
img = predicted_semantic_map.detach().cpu().numpy()
img = (img == 12)
img = img.astype(np.uint8) * 255
return img
class TRI3DATRParseBatch:
@@ -1091,7 +1018,7 @@ class TRI3DDWPose_Preprocessor:
CATEGORY = "TRI3D"
def estimate_pose(self, images, detect_hand, detect_body, detect_face,
filename_path):
**kwargs):
from .dwpose import DwposeDetector
detect_hand = detect_hand == "enable"
@@ -1117,7 +1044,8 @@ class TRI3DDWPose_Preprocessor:
include_face=detect_face,
include_body=detect_body)
cur_file_dir = os.path.dirname(os.path.realpath(__file__))
save_file_path = os.path.join(cur_file_dir, filename_path)
save_file_path = os.path.join(cur_file_dir,
kwargs['filename_path'])
json.dump(pose_dict, open(save_file_path, 'w'))
np_result = cv2.resize(np_result, (W, H),
interpolation=cv2.INTER_AREA)
@@ -1176,19 +1104,21 @@ class TRI3DPoseAdaption:
def INPUT_TYPES(s):
return {
"required": {
"input_pose_json_file": ("STRING",{"default" : "dwpose/keypoints/input.json"}),
"ref_pose_json_file": ("STRING",{"default" : "dwpose/keypoints/ref-pose.json"}),
"image_angle": (["front", "back","back_fixed","back_fixed_left","back_fixed_right"], {"default": "front"}),
"input_pose_json_file": ("STRING", {
"default": "dwpose/keypoints"
}),
"ref_pose_json_file": ("STRING", {
"default": "dwpose/keypoints"
}),
"image_angle": (["front", "side", "back"], {
"default": "front"
}),
"rotation_threshold": ("FLOAT", {
"default": 5.0,
"min": 0.0,
"max": 15.0,
"step": 0.01
}),
"garment_category":([" no_sleeve_garment", "half_sleeve_garment", "full_sleeve_garment", \
"shorts", "trouser"], {"default": " no_sleeve_garment"})
})
}
}
@@ -1197,7 +1127,7 @@ class TRI3DPoseAdaption:
CATEGORY = "TRI3D"
def main(self, input_pose_json_file, ref_pose_json_file, image_angle,
rotation_threshold, garment_category):
rotation_threshold):
from .dwpose import comfy_utils
if image_angle == "front":
@@ -1213,30 +1143,26 @@ class TRI3DPoseAdaption:
ref_height = ref_pose['height']
ref_width = ref_pose['width']
ref_keypoints = ref_pose['keypoints']
similar_torso = None
#check torso similarity
if garment_category not in ["shorts", "trouser"]:
ls_angle_1, rs_angle_1, torso_angle_1 = comfy_utils.get_torso_angles(
input_keypoints)
ls_angle_2, rs_angle_2, torso_angle_2 = comfy_utils.get_torso_angles(
ref_keypoints)
ls_angle_1, rs_angle_1, torso_angle_1 = comfy_utils.get_torso_angles(
input_keypoints)
ls_angle_2, rs_angle_2, torso_angle_2 = comfy_utils.get_torso_angles(
ref_keypoints)
ls_angle_diff = abs(ls_angle_2 - ls_angle_1)
rs_angle_diff = abs(rs_angle_2 - rs_angle_1)
torso_angle_diff = abs(torso_angle_2 - torso_angle_1)
ls_angle_diff = abs(ls_angle_2 - ls_angle_1)
rs_angle_diff = abs(rs_angle_2 - rs_angle_1)
torso_angle_diff = abs(torso_angle_2 - torso_angle_1)
similar_torso = False if (
ls_angle_diff >= rotation_threshold) | (
rs_angle_diff >= rotation_threshold) | (
torso_angle_diff >= rotation_threshold) else True
similar_torso = False if (ls_angle_diff >= rotation_threshold) | (
rs_angle_diff >= rotation_threshold) | (
torso_angle_diff >= rotation_threshold) else True
if similar_torso == False:
canvas = torch.from_numpy(
canvas.astype(np.float32) / 255.0)[
None,
]
return (canvas, similar_torso)
if similar_torso == False:
canvas = torch.from_numpy(canvas.astype(np.float32) / 255.0)[
None,
]
return (canvas, similar_torso)
#Hands
if input_keypoints[4] == [-1, -1]:
@@ -1247,21 +1173,17 @@ class TRI3DPoseAdaption:
input_keypoints[88:] = ref_keypoints[
88:] #replace hands with reference hands
if garment_category not in [
"half_sleeve_garment", "full_sleeve_garment"
]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 2,
3) # rotate left elbow
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 2,
3) # rotate left elbow
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 2, 5, 2,
ref_keypoints, input_keypoints, 1, 2, 2,
3) #scaling w.r.t to shoulder to elbow ratio of ref pose
prev_lw = input_keypoints[4]
if garment_category != "full_sleeve_garment":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 3,
4) #rotate left wrist
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 3,
4) #rotate left wrist
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 2, 3, 3,
4) #scaling w.r.t to elbow to wrist ratio of ref pose
@@ -1279,21 +1201,17 @@ class TRI3DPoseAdaption:
ref_keypoints, input_keypoints, 3, 4,
109) #scaling left hand w.r.t left wrist
if garment_category not in [
"half_sleeve_garment", "full_sleeve_garment"
]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 5,
6) #rotate right elbow
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 5,
6) #rotate right elbow
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 2, 5, 5,
ref_keypoints, input_keypoints, 1, 5, 5,
6) #scaling w.r.t to shoulder to elbow ratio of ref pose
prev_rw = input_keypoints[7]
if garment_category != "full_sleeve_garment":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 6,
7) #rotate right wrist
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 6,
7) #rotate right wrist
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 5, 6, 6,
7) #scaling w.r.t to elbow to wrist ratio of ref pose
@@ -1312,33 +1230,26 @@ class TRI3DPoseAdaption:
88) #scaling right hand w.r.t right wrist
#legs
if garment_category not in ["trouser", "shorts"]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 8,
9) #rotate left knee
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 8,
9) #rotate left knee
input_keypoints = comfy_utils.scale(ref_keypoints, input_keypoints,
1, 8, 8, 9) #scale left knee
if garment_category != "trouser":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 9,
10) #rotate left foot
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 9,
10) #rotate left foot
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 8, 9, 9,
10) #scaling w.r.t to knee to foot ratio of ref pose
if garment_category not in ["trouser", "shorts"]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 11,
12) #rotate right knee
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 11,
12) #rotate right knee
input_keypoints = comfy_utils.scale(ref_keypoints, input_keypoints,
1, 11, 11,
12) #scale right knee
if garment_category != "trouser":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 12,
13) #rotate right foot
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 12,
13) #rotate right foot
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 11, 12, 12,
13) #scaling w.r.t to knee to foot ratio of ref pose
@@ -1395,7 +1306,7 @@ class TRI3DPoseAdaption:
]
return (canvas, similar_torso)
if 'back' in image_angle:
if image_angle == "back":
input_pose = json.load(open(input_pose_json_file))
input_height = input_pose['height']
@@ -1406,46 +1317,28 @@ class TRI3DPoseAdaption:
canvas = np.zeros(shape=(input_height, input_width, 3),
dtype=np.uint8)
if 'back_fixed' in image_angle:
back_pose_dir = pathlib.Path().resolve(
) / 'custom_nodes/tri3d-comfyui-nodes/samples/back_poses/'
back_pose_dictionary = {
'back_fixed': 'backpose.json',
'back_fixed_left': 'left_backpose.json',
'back_fixed_right': 'right_backpose.json'
}
ref_pose_json_file = back_pose_dir / back_pose_dictionary[
image_angle]
# /home/ubuntu/GITHUB/comfyanonymous/ComfyUI/custom_nodes/tri3d-comfyui-nodes
print(ref_pose_json_file)
ref_pose = json.load(open(ref_pose_json_file))
ref_keypoints = ref_pose['keypoints']
similar_torso = None
#check torso similarity
if garment_category not in ["shorts", "trouser"]:
ls_angle_1, rs_angle_1, torso_angle_1 = comfy_utils.get_torso_angles(
input_keypoints)
ls_angle_2, rs_angle_2, torso_angle_2 = comfy_utils.get_torso_angles(
ref_keypoints)
ls_angle_1, rs_angle_1, torso_angle_1 = comfy_utils.get_torso_angles(
input_keypoints)
ls_angle_2, rs_angle_2, torso_angle_2 = comfy_utils.get_torso_angles(
ref_keypoints)
ls_angle_diff = abs(ls_angle_2 - ls_angle_1)
rs_angle_diff = abs(rs_angle_2 - rs_angle_1)
torso_angle_diff = abs(torso_angle_2 - torso_angle_1)
ls_angle_diff = abs(ls_angle_2 - ls_angle_1)
rs_angle_diff = abs(rs_angle_2 - rs_angle_1)
torso_angle_diff = abs(torso_angle_2 - torso_angle_1)
similar_torso = False if (ls_angle_diff >= 5) | (
rs_angle_diff >= 5) | (torso_angle_diff >= 5) else True
similar_torso = False if (ls_angle_diff >= 5) | (
rs_angle_diff >= 5) | (torso_angle_diff >= 5) else True
if similar_torso == False:
canvas = torch.from_numpy(
canvas.astype(np.float32) / 255.0)[
None,
]
return (canvas, similar_torso)
if similar_torso == False:
canvas = torch.from_numpy(canvas.astype(np.float32) / 255.0)[
None,
]
return (canvas, similar_torso)
#Removing the face points if existed
null_indices = [
@@ -1455,16 +1348,12 @@ class TRI3DPoseAdaption:
for i in null_indices:
input_keypoints[i] = [-1, -1]
all_x = [i[0] for i in input_keypoints if i[0] != -1]
min_width = min(all_x)
max_width = max(all_x)
if input_pose_type == "front_pose":
#flip horizontally
for i in range(len(input_keypoints)):
x, y = input_keypoints[i]
if input_keypoints[i] == [-1, -1]: continue
input_keypoints[i] = [(max_width - x) + min_width, y]
input_keypoints[i] = [input_width - x, y]
#Hands
if input_keypoints[4] == [-1, -1]:
@@ -1474,21 +1363,17 @@ class TRI3DPoseAdaption:
input_keypoints[88:] = ref_keypoints[
88:] #replace hands with reference hands
if garment_category not in [
"half_sleeve_garment", "full_sleeve_garment"
]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 2,
3) # rotate left elbow
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 2,
3) # rotate left elbow
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 2, 5, 2,
ref_keypoints, input_keypoints, 1, 2, 2,
3) #scaling w.r.t to shoulder to elbow ratio of ref pose
prev_lw = input_keypoints[4]
if garment_category != "full_sleeve_garment":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 3,
4) #rotate left wrist
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 3,
4) #rotate left wrist
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 2, 3, 3,
4) #scaling w.r.t to elbow to wrist ratio of ref pose
@@ -1506,21 +1391,17 @@ class TRI3DPoseAdaption:
ref_keypoints, input_keypoints, 3, 4,
109) #scaling left hand w.r.t left wrist
if garment_category not in [
"half_sleeve_garment", "full_sleeve_garment"
]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 5,
6) #rotate right elbow
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 5,
6) #rotate right elbow
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 2, 5, 5,
ref_keypoints, input_keypoints, 1, 5, 5,
6) #scaling w.r.t to shoulder to elbow ratio of ref pose
prev_rw = input_keypoints[7]
if garment_category != "full_sleeve_garment":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 6,
7) #rotate right wrist
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 6,
7) #rotate right wrist
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 5, 6, 6,
7) #scaling w.r.t to elbow to wrist ratio of ref pose
@@ -1539,35 +1420,26 @@ class TRI3DPoseAdaption:
88) #scaling right hand w.r.t right wrist
#legs
if garment_category not in ["trouser", "shorts"]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 8,
9) #rotate left knee
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 8,
9) #rotate left knee
input_keypoints = comfy_utils.scale(ref_keypoints, input_keypoints,
1, 8, 8, 9) #scale left knee
if garment_category != "trouser":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 9,
10) #rotate left foot
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 9,
10) #rotate left foot
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 8, 9, 9,
10) #scaling w.r.t to knee to foot ratio of ref pose
if garment_category not in [
"half_sleeve_garment", "full_sleeve_garment"
]:
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 11,
12) #rotate right knee
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 11,
12) #rotate right knee
input_keypoints = comfy_utils.scale(ref_keypoints, input_keypoints,
1, 11, 11,
12) #scale right knee
if garment_category != "trouser":
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 12,
13) #rotate right foot
input_keypoints = comfy_utils.rotate(ref_keypoints,
input_keypoints, 12,
13) #rotate right foot
input_keypoints = comfy_utils.scale(
ref_keypoints, input_keypoints, 11, 12, 12,
13) #scaling w.r.t to knee to foot ratio of ref pose
@@ -1739,76 +1611,6 @@ class TRI3DFaceRecognise:
return ({"overlap (float)": s}, )
class FloatToImage:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"value": ("FLOAT", {
"default": 0.0,
"min": 0.0,
"max": 1.0,
"step": 0.01
})
}
}
CATEGORY = "TRI3D"
RETURN_TYPES = ("IMAGE", )
FUNCTION = "load_image"
def load_image(self, value):
def render_float(float_input):
latex_expression = '$' + str(float_input) + '$'
import matplotlib.pyplot as plt
fig = plt.figure(
figsize=(10, 4)) # Dimensions of figsize are in inches
text = fig.text(
x=0.5, # x-coordinate to place the text
y=0.5, # y-coordinate to place the text
s=latex_expression,
horizontalalignment="center",
verticalalignment="center",
fontsize=32,
)
import tempfile
path_file_image_output = tempfile.NamedTemporaryFile(
).name + '.png'
plt.savefig(path_file_image_output)
import cv2
image = cv2.imread(path_file_image_output, cv2.IMREAD_COLOR)
import os
# os.unlink(path_file_image_output)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
return image
def to_torch_image(image):
import numpy as np
import torch
image = image.astype(dtype=np.float32)
image /= 255.0
image = torch.from_numpy(image)[
None,
]
image = image.unsqueeze(0)
return image
image = render_float(float_input=value)
image = to_torch_image(image)
return image
class TRI3D_recolor_LAB:
@classmethod
@@ -2179,141 +1981,73 @@ class TRI3D_recolor:
return image_output
class TRI3D_image_mask_2_box:
def __init__(self):
pass
class FloatToImage:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"image": ("IMAGE", ),
"mask": ("MASK", ),
},
"value": ("FLOAT", {
"default": 0.0,
"min": 0.0,
"max": 1.0,
"step": 0.01
})
}
}
FUNCTION = "run"
RETURN_TYPES = ("IMAGE", )
CATEGORY = "HackNode"
def run(self, image, mask):
image = from_torch_image(image)
mask = from_torch_image(mask)
image = extract_box_from_image(image, mask)
image = to_torch_image(image)
return image
class TRI3D_image_mask_box_2_image:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"image": ("IMAGE", ),
"mask": ("MASK", ),
"box": ("IMAGE", ),
},
}
FUNCTION = "run"
RETURN_TYPES = ("IMAGE", )
CATEGORY = "HackNode"
def run(self, image, mask, box):
image = from_torch_image(image)
mask = from_torch_image(mask)
box = from_torch_image(box)
image = stitch_back_box_to_image(image, mask, box)
image = to_torch_image(image)
return image
class TRI3D_clipdrop_bgremove_api:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"image": ("IMAGE", )
},
}
FUNCTION = "run"
RETURN_TYPES = ("IMAGE", )
CATEGORY = "TRI3D"
def run(self, image):
image = from_torch_image(image)
print(image.shape)
_, enc_image = cv2.imencode('.jpg', image)
from dotenv import load_dotenv
load_dotenv()
CLIPDROP_API_KEY = os.getenv('CLIPDROP_API_KEY')
# CLIPDROP_API_KEY = os.environ.get('CLIPDROP_API_KEY')
r = requests.post('https://clipdrop-api.co/remove-background/v1',
files={
'image_file':
("mannequin.jpg", enc_image.tobytes(),
'image/jpeg'),
},
headers={'x-api-key': CLIPDROP_API_KEY})
if (r.ok):
pass
else:
r.raise_for_status()
output = np.array(Image.open(io.BytesIO(r.content)))
output = cv2.cvtColor(output, cv2.COLOR_BGRA2RGBA)
# print("decoded output",output.shape)
# mask = output[:,:,3]
# output = output[:,:,0:3]
output = torch.from_numpy(output.astype(np.float32) / 255.0)[
None,
]
# print("converted image to torch")
# print(output.shape)
# mask = torch.from_numpy(mask.astype(np.float32)/255.0)[None,]
# print("converted mask to torch")
# print(mask.shape)
return output,
class TRI3D_oneformer_person_mask:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"image": ("IMAGE", ),
},
}
FUNCTION = "run"
RETURN_TYPES = ("IMAGE", )
CATEGORY = "tri3d"
FUNCTION = "load_image"
def run(self, image):
image = from_torch_image(image)
def load_image(self, value):
image_final = np.zeros((image.shape[0], image.shape[1], 4),
dtype=np.uint8)
def render_float(float_input):
latex_expression = '$' + str(float_input) + '$'
import matplotlib.pyplot as plt
fig = plt.figure(
figsize=(10, 4)) # Dimensions of figsize are in inches
text = fig.text(
x=0.5, # x-coordinate to place the text
y=0.5, # y-coordinate to place the text
s=latex_expression,
horizontalalignment="center",
verticalalignment="center",
fontsize=32,
)
import tempfile
path_file_image_output = tempfile.NamedTemporaryFile(
).name + '.png'
plt.savefig(path_file_image_output)
import cv2
image = cv2.imread(path_file_image_output, cv2.IMREAD_COLOR)
import os
# os.unlink(path_file_image_output)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
return image
def to_torch_image(image):
import numpy as np
import torch
image = image.astype(dtype=np.float32)
image /= 255.0
image = torch.from_numpy(image)[
None,
]
image = image.unsqueeze(0)
return image
image = render_float(float_input=value)
image = to_torch_image(image)
image_final[:, :, 0:3] = image
image = get_segmentation_of_person(image)
image_final[:, :, 3] = image[:, :]
image = to_torch_image(image_final)
return image
@@ -2336,53 +2070,27 @@ NODE_CLASS_MAPPINGS = {
"tri3d-recolor-mask": TRI3D_recolor,
"tri3d-recolor-mask-LAB_space": TRI3D_recolor_LAB,
"tri3d-recolor-mask-RGB_space": TRI3D_recolor_RGB,
"tri3d-image-mask-2-box": TRI3D_image_mask_2_box,
"tri3d-image-mask-box-2-image": TRI3D_image_mask_box_2_image,
"tri3d-clipdrop-bgremove-api": TRI3D_clipdrop_bgremove_api,
"tri3d-oneformer-person-mask": TRI3D_oneformer_person_mask,
}
VERSION = "2.3"
VERSION = "1.7.0"
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"tri3d-atr-parse-batch":
"ATR Parse Batch" + " v" + VERSION,
'tri3d-extract-parts-batch':
'Extract Parts Batch' + " v" + VERSION,
'tri3d-extract-parts-batch2':
'Extract Parts Batch 2' + " v" + VERSION,
"tri3d-position-parts-batch":
"Position Parts Batch" + " v" + VERSION,
"tri3d-swap-pixels":
"Swap Pixels by Mask" + " v" + VERSION,
"tri3d-atr-parse-batch": "ATR Parse Batch" + " v" + VERSION,
'tri3d-extract-parts-batch': 'Extract Parts Batch' + " v" + VERSION,
'tri3d-extract-parts-batch2': 'Extract Parts Batch 2' + " v" + VERSION,
"tri3d-position-parts-batch": "Position Parts Batch" + " v" + VERSION,
"tri3d-swap-pixels": "Swap Pixels by Mask" + " v" + VERSION,
"tri3d-skin-feathered-padded-mask":
"Skin Feathered Padded Mask" + " v" + VERSION,
"tri3d-interaction-canny":
"Garment Skin Interaction Canny" + " v" + VERSION,
"tri3d-dwpose":
"DWPose" + " v" + VERSION,
"tri3d-pose-to-image":
"Pose to Image" + " v" + VERSION,
"tri3d-pose-adaption":
"Pose Adaption" + " v" + VERSION,
"tri3d-load-pose-json":
"Load Pose Json" + " v" + VERSION,
"tri3d-face-recognise":
"Recognise face" + " v" + VERSION,
"tri3d-float-to-image":
"Render float" + " v" + VERSION,
"tri3d-recolor-mask":
"Recolor mask HSV space" + " v" + VERSION,
"tri3d-recolor-mask-LAB_space":
"Recolor mask LAB space" + " v" + VERSION,
"tri3d-recolor-mask-RGB_space":
"Recolor mask RGB space" + " v" + VERSION,
"tri3d--image-mask-2-box":
"Extract box from image" + " v" + VERSION,
"tri3d-image-mask-box-2-image":
"Stitch box to image" + " v" + VERSION,
"tri3d-clipdrop-bgremove-api":
"RemBG ClipDrop" + " v" + VERSION,
"tri3d-oneformer-person-mask":
"Get person mask using oneformer" + " v" + VERSION,
"tri3d-dwpose": "DWPose" + " v" + VERSION,
"tri3d-pose-to-image": "Pose to Image" + " v" + VERSION,
"tri3d-pose-adaption": "Pose Adaption" + " v" + VERSION,
"tri3d-load-pose-json": "Load Pose Json" + " v" + VERSION,
"tri3d-face-recognise": "Recognise face" + " v" + VERSION,
"tri3d-float-to-image": "Render float" + " v" + VERSION,
"tri3d-recolor-mask": "Recolor mask HSV space" + " v" + VERSION,
"tri3d-recolor-mask-LAB_space": "Recolor mask LAB space" + " v" + VERSION,
"tri3d-recolor-mask-RGB_space": "Recolor mask RGB space" + " v" + VERSION,
}
+2 -2
View File
@@ -67,11 +67,11 @@
-1
],
[
279,
246,
74
],
[
246,
279,
74
],
[
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,526 +0,0 @@
{
"height": 512,
"width": 512,
"keypoints": [
[
259,
75
],
[
261,
127
],
[
222,
133
],
[
208,
196
],
[
199,
253
],
[
296,
132
],
[
316,
192
],
[
333,
246
],
[
241,
249
],
[
242,
348
],
[
255,
448
],
[
277,
248
],
[
296,
344
],
[
322,
448
],
[
251,
69
],
[
268,
67
],
[
237,
77
],
[
280,
73
],
[
239,
71
],
[
239,
77
],
[
241,
81
],
[
243,
87
],
[
243,
91
],
[
247,
95
],
[
251,
96
],
[
255,
100
],
[
261,
100
],
[
264,
98
],
[
270,
96
],
[
272,
93
],
[
276,
89
],
[
278,
83
],
[
278,
79
],
[
278,
73
],
[
278,
69
],
[
243,
66
],
[
245,
66
],
[
249,
64
],
[
251,
64
],
[
255,
64
],
[
262,
64
],
[
266,
62
],
[
268,
62
],
[
272,
62
],
[
274,
64
],
[
259,
69
],
[
259,
71
],
[
259,
73
],
[
261,
77
],
[
255,
79
],
[
259,
79
],
[
261,
79
],
[
262,
79
],
[
264,
79
],
[
247,
69
],
[
249,
69
],
[
251,
67
],
[
255,
69
],
[
251,
69
],
[
249,
69
],
[
264,
69
],
[
266,
67
],
[
268,
67
],
[
272,
67
],
[
268,
69
],
[
266,
69
],
[
251,
87
],
[
255,
83
],
[
259,
83
],
[
261,
83
],
[
262,
83
],
[
264,
83
],
[
268,
85
],
[
266,
87
],
[
264,
91
],
[
261,
91
],
[
257,
91
],
[
253,
89
],
[
251,
87
],
[
255,
85
],
[
261,
85
],
[
264,
85
],
[
268,
85
],
[
264,
87
],
[
261,
89
],
[
255,
89
],
[
251,
69
],
[
268,
67
],
[
333,
249
],
[
328,
255
],
[
324,
262
],
[
322,
270
],
[
320,
278
],
[
331,
270
],
[
329,
278
],
[
324,
278
],
[
322,
276
],
[
335,
272
],
[
329,
278
],
[
326,
278
],
[
322,
276
],
[
337,
272
],
[
331,
278
],
[
328,
278
],
[
326,
276
],
[
337,
270
],
[
333,
276
],
[
329,
276
],
[
328,
276
],
[
199,
256
],
[
203,
263
],
[
207,
267
],
[
209,
275
],
[
209,
283
],
[
199,
277
],
[
203,
285
],
[
207,
283
],
[
211,
281
],
[
197,
279
],
[
201,
285
],
[
207,
283
],
[
209,
281
],
[
196,
277
],
[
201,
283
],
[
205,
283
],
[
209,
281
],
[
197,
277
],
[
201,
281
],
[
203,
281
],
[
205,
279
]
]
}
-526
View File
@@ -1,526 +0,0 @@
{
"height": 512,
"width": 512,
"keypoints": [
[
-1,
-1
],
[
264,
125
],
[
298,
125
],
[
310,
193
],
[
314,
254
],
[
230,
125
],
[
216,
192
],
[
211,
252
],
[
286,
244
],
[
292,
339
],
[
294,
448
],
[
240,
247
],
[
242,
336
],
[
246,
444
],
[
-1,
-1
],
[
-1,
-1
],
[
279,
74
],
[
246,
74
],
[
240,
66
],
[
240,
72
],
[
240,
76
],
[
242,
82
],
[
242,
86
],
[
246,
88
],
[
248,
92
],
[
252,
94
],
[
258,
94
],
[
262,
94
],
[
266,
94
],
[
270,
92
],
[
274,
90
],
[
276,
86
],
[
278,
82
],
[
280,
78
],
[
282,
74
],
[
248,
58
],
[
250,
56
],
[
252,
56
],
[
256,
56
],
[
260,
56
],
[
268,
58
],
[
272,
58
],
[
274,
60
],
[
278,
62
],
[
280,
64
],
[
264,
64
],
[
262,
66
],
[
262,
68
],
[
262,
68
],
[
258,
74
],
[
258,
74
],
[
262,
74
],
[
264,
74
],
[
266,
74
],
[
250,
62
],
[
252,
62
],
[
256,
62
],
[
258,
62
],
[
254,
64
],
[
252,
62
],
[
268,
64
],
[
272,
64
],
[
274,
64
],
[
276,
68
],
[
274,
68
],
[
270,
66
],
[
252,
80
],
[
256,
78
],
[
258,
78
],
[
260,
78
],
[
262,
78
],
[
266,
80
],
[
268,
82
],
[
266,
84
],
[
262,
84
],
[
260,
84
],
[
256,
84
],
[
254,
82
],
[
252,
80
],
[
256,
78
],
[
260,
78
],
[
264,
80
],
[
268,
82
],
[
264,
84
],
[
260,
82
],
[
256,
82
],
[
254,
62
],
[
272,
64
],
[
211,
255
],
[
221,
262
],
[
226,
268
],
[
229,
272
],
[
232,
278
],
[
217,
279
],
[
223,
286
],
[
229,
288
],
[
232,
291
],
[
214,
281
],
[
221,
288
],
[
223,
291
],
[
229,
291
],
[
211,
281
],
[
217,
286
],
[
223,
288
],
[
223,
291
],
[
211,
281
],
[
214,
286
],
[
217,
288
],
[
221,
288
],
[
314.2191598676356,
257
],
[
308.2191598676356,
262
],
[
306.2191598676356,
266
],
[
303.2191598676356,
270
],
[
301.2191598676356,
276
],
[
312.2191598676356,
279
],
[
311.2191598676356,
284
],
[
308.2191598676356,
290
],
[
303.2191598676356,
292
],
[
313.2191598676356,
279
],
[
312.2191598676356,
284
],
[
311.2191598676356,
290
],
[
307.2191598676356,
292
],
[
314.2191598676356,
279
],
[
313.2191598676356,
284
],
[
312.2191598676356,
289
],
[
311.2191598676356,
293
],
[
317.2191598676356,
279
],
[
314.2191598676356,
283
],
[
313.2191598676356,
287
],
[
312.2191598676356,
290
]
]
}
-526
View File
@@ -1,526 +0,0 @@
{
"height": 512,
"width": 512,
"keypoints": [
[
234,
85
],
[
264,
125
],
[
298,
125
],
[
310,
193
],
[
314,
254
],
[
230,
125
],
[
216,
192
],
[
211,
252
],
[
286,
244
],
[
292,
339
],
[
294,
448
],
[
240,
247
],
[
242,
336
],
[
246,
444
],
[
-1,
-1
],
[
238,
72
],
[
-1,
-1
],
[
262,
70
],
[
212,
82
],
[
212,
88
],
[
212,
92
],
[
214,
98
],
[
214,
102
],
[
218,
104
],
[
220,
108
],
[
224,
110
],
[
230,
110
],
[
234,
110
],
[
238,
110
],
[
242,
108
],
[
246,
106
],
[
248,
102
],
[
250,
98
],
[
252,
94
],
[
254,
90
],
[
220,
74
],
[
222,
72
],
[
224,
72
],
[
228,
72
],
[
232,
72
],
[
240,
74
],
[
244,
74
],
[
246,
76
],
[
250,
78
],
[
252,
80
],
[
236,
80
],
[
234,
82
],
[
232,
84
],
[
255,
85
],
[
230,
90
],
[
230,
90
],
[
234,
90
],
[
236,
90
],
[
238,
90
],
[
222,
78
],
[
224,
78
],
[
228,
78
],
[
230,
78
],
[
226,
80
],
[
224,
78
],
[
240,
80
],
[
244,
80
],
[
246,
80
],
[
248,
84
],
[
246,
84
],
[
242,
82
],
[
224,
96
],
[
228,
94
],
[
230,
94
],
[
232,
94
],
[
234,
94
],
[
238,
96
],
[
240,
98
],
[
238,
100
],
[
234,
100
],
[
232,
100
],
[
228,
100
],
[
226,
98
],
[
224,
96
],
[
228,
94
],
[
232,
94
],
[
236,
96
],
[
240,
98
],
[
236,
100
],
[
232,
98
],
[
228,
98
],
[
226,
78
],
[
244,
80
],
[
211,
255
],
[
221,
262
],
[
226,
268
],
[
229,
272
],
[
232,
278
],
[
217,
279
],
[
223,
286
],
[
229,
288
],
[
232,
291
],
[
214,
281
],
[
221,
288
],
[
223,
291
],
[
229,
291
],
[
211,
281
],
[
217,
286
],
[
223,
288
],
[
223,
291
],
[
211,
281
],
[
214,
286
],
[
217,
288
],
[
221,
288
],
[
314,
257
],
[
308,
262
],
[
306,
266
],
[
303,
270
],
[
301,
276
],
[
312,
279
],
[
311,
284
],
[
308,
290
],
[
303,
292
],
[
313,
279
],
[
312,
284
],
[
311,
290
],
[
307,
292
],
[
314,
279
],
[
313,
284
],
[
312,
289
],
[
311,
293
],
[
317,
279
],
[
314,
283
],
[
313,
287
],
[
312,
290
]
]
}
-526
View File
@@ -1,526 +0,0 @@
{
"height": 512,
"width": 512,
"keypoints": [
[
298,
85
],
[
264,
125
],
[
298,
125
],
[
310,
193
],
[
314,
254
],
[
230,
125
],
[
216,
192
],
[
211,
252
],
[
286,
244
],
[
292,
339
],
[
294,
448
],
[
240,
247
],
[
242,
336
],
[
246,
444
],
[
293.3658724790831,
75
],
[
-1,
-1
],
[
270.3658724790831,
73
],
[
-1,
-1
],
[
276.3658724790831,
82
],
[
276.3658724790831,
88
],
[
276.3658724790831,
92
],
[
278.3658724790831,
98
],
[
278.3658724790831,
102
],
[
282.3658724790831,
104
],
[
284.3658724790831,
108
],
[
288.3658724790831,
110
],
[
294.3658724790831,
110
],
[
298.3658724790831,
110
],
[
302.3658724790831,
110
],
[
306.3658724790831,
108
],
[
310.3658724790831,
106
],
[
312.3658724790831,
102
],
[
314.3658724790831,
98
],
[
316.3658724790831,
94
],
[
318.3658724790831,
90
],
[
284.3658724790831,
74
],
[
286.3658724790831,
72
],
[
288.3658724790831,
72
],
[
292.3658724790831,
72
],
[
296.3658724790831,
72
],
[
304.3658724790831,
74
],
[
308.3658724790831,
74
],
[
310.3658724790831,
76
],
[
314.3658724790831,
78
],
[
316.3658724790831,
80
],
[
300.3658724790831,
80
],
[
298.3658724790831,
82
],
[
296.3658724790831,
84
],
[
319.3658724790831,
85
],
[
294.3658724790831,
90
],
[
294.3658724790831,
90
],
[
298.3658724790831,
90
],
[
300.3658724790831,
90
],
[
302.3658724790831,
90
],
[
286.3658724790831,
78
],
[
288.3658724790831,
78
],
[
292.3658724790831,
78
],
[
294.3658724790831,
78
],
[
290.3658724790831,
80
],
[
288.3658724790831,
78
],
[
304.3658724790831,
80
],
[
308.3658724790831,
80
],
[
310.3658724790831,
80
],
[
312.3658724790831,
84
],
[
310.3658724790831,
84
],
[
306.3658724790831,
82
],
[
288.3658724790831,
96
],
[
292.3658724790831,
94
],
[
294.3658724790831,
94
],
[
296.3658724790831,
94
],
[
298.3658724790831,
94
],
[
302.3658724790831,
96
],
[
304.3658724790831,
98
],
[
302.3658724790831,
100
],
[
298.3658724790831,
100
],
[
296.3658724790831,
100
],
[
292.3658724790831,
100
],
[
290.3658724790831,
98
],
[
288.3658724790831,
96
],
[
292.3658724790831,
94
],
[
296.3658724790831,
94
],
[
300.3658724790831,
96
],
[
304.3658724790831,
98
],
[
300.3658724790831,
100
],
[
296.3658724790831,
98
],
[
292.3658724790831,
98
],
[
290.3658724790831,
78
],
[
308.3658724790831,
80
],
[
211,
255
],
[
221,
262
],
[
226,
268
],
[
229,
272
],
[
232,
278
],
[
217,
279
],
[
223,
286
],
[
229,
288
],
[
232,
291
],
[
214,
281
],
[
221,
288
],
[
223,
291
],
[
229,
291
],
[
211,
281
],
[
217,
286
],
[
223,
288
],
[
223,
291
],
[
211,
281
],
[
214,
286
],
[
217,
288
],
[
221,
288
],
[
314,
257
],
[
308,
262
],
[
306,
266
],
[
303,
270
],
[
301,
276
],
[
312,
279
],
[
311,
284
],
[
308,
290
],
[
303,
292
],
[
313,
279
],
[
312,
284
],
[
311,
290
],
[
307,
292
],
[
314,
279
],
[
313,
284
],
[
312,
289
],
[
311,
293
],
[
317,
279
],
[
314,
283
],
[
313,
287
],
[
312,
290
]
]
}