Datasets:
EntropyDrop commited on
Commit ·
d0e5423
1
Parent(s): ffce056
v95
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- build_target_img.py +26 -28
- build_target_imgs.py +1 -1
- control_imgs/0f2c9a15bd13b738.png +0 -3
- control_imgs/12.png +0 -3
- control_imgs/188486.png +0 -3
- control_imgs/198224.png +0 -3
- control_imgs/2c35b77ee2cdfd42.png +0 -3
- control_imgs/386c002183750df9.png +0 -3
- control_imgs/5002d28d665fc668.png +0 -3
- control_imgs/509dd472891584c0.png +0 -3
- control_imgs/517485.png +0 -3
- control_imgs/519494.png +0 -3
- control_imgs/525273.png +0 -3
- control_imgs/538419.png +0 -3
- control_imgs/553045.png +0 -3
- control_imgs/560261.png +0 -3
- control_imgs/64154.png +0 -3
- control_imgs/64154f.png +0 -3
- control_imgs/645888.png +0 -3
- control_imgs/667114.png +0 -3
- control_imgs/8880001.png +0 -3
- control_imgs/8880002.png +0 -3
- control_imgs/8880007.png +0 -3
- control_imgs/8880011.png +0 -3
- control_imgs/8880022.png +0 -3
- control_imgs/8880022f.png +0 -3
- control_imgs/8880023.png +0 -3
- control_imgs/8880023f.png +0 -3
- control_imgs/8880100.png +0 -3
- control_imgs/8880106.png +0 -3
- control_imgs/8880108.png +0 -3
- control_imgs/8880200.png +0 -3
- control_imgs/8880201.png +0 -3
- control_imgs/8880400.png +0 -3
- control_imgs/8880400f.png +0 -3
- control_imgs/8880500.png +0 -3
- control_imgs/8880501.png +0 -3
- control_imgs/8880502.png +0 -3
- control_imgs/8880503.png +0 -3
- control_imgs/8880600.png +0 -3
- control_imgs/8880602.png +0 -3
- control_imgs/8880700.png +0 -3
- control_imgs/8880800.png +0 -3
- control_imgs/8880803.png +0 -3
- control_imgs/8880810.png +0 -3
- control_imgs/8880812.png +0 -3
- control_imgs/8882000.png +0 -3
- control_imgs/8882001.png +0 -3
- control_imgs/9874eccccd0dc1c0.png +0 -3
- control_imgs/a5c3a615940c35cf.png +0 -3
build_target_img.py
CHANGED
|
@@ -10,12 +10,8 @@ import mc_render
|
|
| 10 |
import random
|
| 11 |
from mc_voxel_texture_resolver import resolve_voxel_consistency
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
IMAGE_WIDTH = 768
|
| 16 |
-
IMAGE_HEIGHT = 768
|
| 17 |
-
|
| 18 |
-
SCALING_RATIO = 12*IMAGE_HEIGHT/768
|
| 19 |
|
| 20 |
SKIN_MASK = "skin-mask.png"
|
| 21 |
SKIN_DECOR_MASK = "skin-decor-mask.png"
|
|
@@ -100,7 +96,8 @@ def create_training_image(skin_image):
|
|
| 100 |
|
| 101 |
|
| 102 |
training_image = Image.new('RGBA', (IMAGE_WIDTH, IMAGE_HEIGHT), (*bg, 255))
|
| 103 |
-
|
|
|
|
| 104 |
resample=Image.BOX)
|
| 105 |
#scaled_first_layer = skin_image_first_layer.resize((int(32 * SCALING_RATIO), int(32 * SCALING_RATIO)),
|
| 106 |
# resample=Image.BOX)
|
|
@@ -122,8 +119,8 @@ def create_training_image(skin_image):
|
|
| 122 |
y_indices, x_indices = np.where(skin_arr[..., 3] == 0)
|
| 123 |
|
| 124 |
for x, y in zip(x_indices, y_indices):
|
| 125 |
-
cx = int(
|
| 126 |
-
cy = int(
|
| 127 |
# Apply 2x2 white dot
|
| 128 |
tr_arr[cy-1:cy+1, cx-1:cx+1] = [255, 255, 255, 255]
|
| 129 |
|
|
@@ -156,33 +153,34 @@ def create_training_image(skin_image):
|
|
| 156 |
'left_leg': (2, 6, 0),
|
| 157 |
}
|
| 158 |
for (ortho, s, look_at_y, core_display, decor_display, cam_front, offset,render_size, zoom, pos_args, walk) in [
|
| 159 |
-
(False, skin_image,12, full_part, full_part, (0.3, 0.4, 0.5), (int(
|
|
|
|
| 160 |
|
| 161 |
-
(False, skin_image,
|
| 162 |
-
(False, skin_image,
|
| 163 |
|
| 164 |
-
(False,skin_image_first_layer,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 165 |
-
(False,skin_image_first_layer,12, full_part, full_part, (-0.5, -0.4, -0.5), (int(IMAGE_WIDTH/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 166 |
|
| 167 |
#left
|
| 168 |
-
(False,skin_image,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH*2/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 169 |
-
(False,skin_image,12, full_part, full_part, (-0.5, -0.4, -0.5), (int(IMAGE_WIDTH*2/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 170 |
|
| 171 |
# right
|
| 172 |
-
(False,skin_image, 12,full_part, full_part, (0.3, -0.4, 0.5),(int(IMAGE_WIDTH*3/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 173 |
-
(False,skin_image, 12,full_part, full_part, (-0.5, 0.4, -0.5),(int(IMAGE_WIDTH*3/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 174 |
|
| 175 |
# head
|
| 176 |
-
(False,skin_image,28, ['head'], ['head'], (-0.3, -0.4, 0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 177 |
-
(False,skin_image,28, ['head'], ['head'], (0.3, -0.4, 0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2 + IMAGE_HEIGHT/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 178 |
-
(False,skin_image,28, ['head'], ['head'], (-0.5, -0.4, -0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2+ IMAGE_HEIGHT*2/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 179 |
-
(False,skin_image,28, ['head'], ['head'], (0.5, -0.4, -0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2+ IMAGE_HEIGHT*3/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 180 |
|
| 181 |
-
(False,skin_image,12, ['body'], ['body'], (0.3, 0.4, 0.5), (int(IMAGE_WIDTH*3/4*1.05), int(IMAGE_HEIGHT*1/5)), (int(IMAGE_WIDTH/4),int(IMAGE_HEIGHT/2)), r_scale4,default_pos_args, False),
|
| 182 |
-
(False,skin_image,12, ['body'], ['body'], (-0.3, 0.4, 0.5), (int(IMAGE_WIDTH*3/4*1.05), int(-IMAGE_HEIGHT*1/8)), (int(IMAGE_WIDTH/4),int(IMAGE_HEIGHT/2)), r_scale4,default_pos_args, False),
|
| 183 |
|
| 184 |
-
(False,skin_image,22, [], ['head'], (0.3, 0.3, 0), (int(IMAGE_WIDTH*1/2*0.95), int(IMAGE_HEIGHT*1/60)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/4.5)), r_scale4,default_pos_args, False),
|
| 185 |
-
(False,skin_image,22, [], ['head'], (-0.3, 0.3, 0), (int(IMAGE_WIDTH*1/2*0.95), int(IMAGE_HEIGHT*20/60)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/4.5)), r_scale4,default_pos_args, False),
|
| 186 |
|
| 187 |
]:
|
| 188 |
# Optimized: Get image directly from memory instead of UUID-named temp files
|
|
@@ -191,7 +189,7 @@ def create_training_image(skin_image):
|
|
| 191 |
output_size=render_size,
|
| 192 |
cam_front=cam_front,
|
| 193 |
look_at_y=look_at_y,
|
| 194 |
-
use_voxels=
|
| 195 |
ortho=ortho,
|
| 196 |
core_display=core_display,
|
| 197 |
decor_display=decor_display,
|
|
@@ -209,7 +207,7 @@ def create_training_image(skin_image):
|
|
| 209 |
'rot_arm_left': (0,0,0),
|
| 210 |
'rot_leg_right': (0,0,0),
|
| 211 |
'rot_leg_left': (0,0,0),
|
| 212 |
-
},save_path=None, transparent_background=True, zoom=zoom, light=
|
| 213 |
|
| 214 |
if img_np is not None:
|
| 215 |
x = Image.fromarray(img_np)
|
|
|
|
| 10 |
import random
|
| 11 |
from mc_voxel_texture_resolver import resolve_voxel_consistency
|
| 12 |
|
| 13 |
+
IMAGE_WIDTH = 512
|
| 14 |
+
IMAGE_HEIGHT = 1024
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
SKIN_MASK = "skin-mask.png"
|
| 17 |
SKIN_DECOR_MASK = "skin-decor-mask.png"
|
|
|
|
| 96 |
|
| 97 |
|
| 98 |
training_image = Image.new('RGBA', (IMAGE_WIDTH, IMAGE_HEIGHT), (*bg, 255))
|
| 99 |
+
SCALING_RATIO = IMAGE_WIDTH/64
|
| 100 |
+
scaled_skin_image = skin_image.resize((int(64 * SCALING_RATIO), int(64 * SCALING_RATIO)),
|
| 101 |
resample=Image.BOX)
|
| 102 |
#scaled_first_layer = skin_image_first_layer.resize((int(32 * SCALING_RATIO), int(32 * SCALING_RATIO)),
|
| 103 |
# resample=Image.BOX)
|
|
|
|
| 119 |
y_indices, x_indices = np.where(skin_arr[..., 3] == 0)
|
| 120 |
|
| 121 |
for x, y in zip(x_indices, y_indices):
|
| 122 |
+
cx = int(x * SCALING_RATIO ) + int(SCALING_RATIO/2)
|
| 123 |
+
cy = int(y * SCALING_RATIO ) + int(SCALING_RATIO/2)
|
| 124 |
# Apply 2x2 white dot
|
| 125 |
tr_arr[cy-1:cy+1, cx-1:cx+1] = [255, 255, 255, 255]
|
| 126 |
|
|
|
|
| 153 |
'left_leg': (2, 6, 0),
|
| 154 |
}
|
| 155 |
for (ortho, s, look_at_y, core_display, decor_display, cam_front, offset,render_size, zoom, pos_args, walk) in [
|
| 156 |
+
(False, skin_image,12, full_part, full_part, (0.3, 0.4, 0.5), (0, int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/2),int(IMAGE_HEIGHT/4*1.2)), r_scale1, default_pos_args, True),
|
| 157 |
+
(False, skin_image,12, full_part, full_part, (-0.3, 0.4, -0.5), (int(IMAGE_WIDTH / 2), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/2),int(IMAGE_HEIGHT/4*1.2)), r_scale1, default_pos_args, True),
|
| 158 |
|
| 159 |
+
(False, skin_image,18,full_part,full_part, (0.0, 0, 0.5),(0, int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/2),int(IMAGE_HEIGHT/4)), 0.28, pos_args2, False),
|
| 160 |
+
(False, skin_image,18,full_part,full_part, (-0.0, -0.0, -0.5),(int(IMAGE_WIDTH/2), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/2),int(IMAGE_HEIGHT/4)), 0.28, pos_args2, False),
|
| 161 |
|
| 162 |
+
#(False,skin_image_first_layer,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 163 |
+
#(False,skin_image_first_layer,12, full_part, full_part, (-0.5, -0.4, -0.5), (int(IMAGE_WIDTH/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 164 |
|
| 165 |
#left
|
| 166 |
+
#(False,skin_image,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH*2/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 167 |
+
#(False,skin_image,12, full_part, full_part, (-0.5, -0.4, -0.5), (int(IMAGE_WIDTH*2/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 168 |
|
| 169 |
# right
|
| 170 |
+
#(False,skin_image, 12,full_part, full_part, (0.3, -0.4, 0.5),(int(IMAGE_WIDTH*3/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 171 |
+
#(False,skin_image, 12,full_part, full_part, (-0.5, 0.4, -0.5),(int(IMAGE_WIDTH*3/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
|
| 172 |
|
| 173 |
# head
|
| 174 |
+
#(False,skin_image,28, ['head'], ['head'], (-0.3, -0.4, 0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 175 |
+
#(False,skin_image,28, ['head'], ['head'], (0.3, -0.4, 0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2 + IMAGE_HEIGHT/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 176 |
+
#(False,skin_image,28, ['head'], ['head'], (-0.5, -0.4, -0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2+ IMAGE_HEIGHT*2/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 177 |
+
#(False,skin_image,28, ['head'], ['head'], (0.5, -0.4, -0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2+ IMAGE_HEIGHT*3/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
|
| 178 |
|
| 179 |
+
#(False,skin_image,12, ['body'], ['body'], (0.3, 0.4, 0.5), (int(IMAGE_WIDTH*3/4*1.05), int(IMAGE_HEIGHT*1/5)), (int(IMAGE_WIDTH/4),int(IMAGE_HEIGHT/2)), r_scale4,default_pos_args, False),
|
| 180 |
+
#(False,skin_image,12, ['body'], ['body'], (-0.3, 0.4, 0.5), (int(IMAGE_WIDTH*3/4*1.05), int(-IMAGE_HEIGHT*1/8)), (int(IMAGE_WIDTH/4),int(IMAGE_HEIGHT/2)), r_scale4,default_pos_args, False),
|
| 181 |
|
| 182 |
+
#(False,skin_image,22, [], ['head'], (0.3, 0.3, 0), (int(IMAGE_WIDTH*1/2*0.95), int(IMAGE_HEIGHT*1/60)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/4.5)), r_scale4,default_pos_args, False),
|
| 183 |
+
#(False,skin_image,22, [], ['head'], (-0.3, 0.3, 0), (int(IMAGE_WIDTH*1/2*0.95), int(IMAGE_HEIGHT*20/60)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/4.5)), r_scale4,default_pos_args, False),
|
| 184 |
|
| 185 |
]:
|
| 186 |
# Optimized: Get image directly from memory instead of UUID-named temp files
|
|
|
|
| 189 |
output_size=render_size,
|
| 190 |
cam_front=cam_front,
|
| 191 |
look_at_y=look_at_y,
|
| 192 |
+
use_voxels=True,
|
| 193 |
ortho=ortho,
|
| 194 |
core_display=core_display,
|
| 195 |
decor_display=decor_display,
|
|
|
|
| 207 |
'rot_arm_left': (0,0,0),
|
| 208 |
'rot_leg_right': (0,0,0),
|
| 209 |
'rot_leg_left': (0,0,0),
|
| 210 |
+
},save_path=None, transparent_background=True, zoom=zoom, light=True)
|
| 211 |
|
| 212 |
if img_np is not None:
|
| 213 |
x = Image.fromarray(img_np)
|
build_target_imgs.py
CHANGED
|
@@ -4,7 +4,7 @@ import sys
|
|
| 4 |
import subprocess
|
| 5 |
from concurrent.futures import ThreadPoolExecutor
|
| 6 |
|
| 7 |
-
output_dir = '
|
| 8 |
|
| 9 |
def process_skin(skin_id):
|
| 10 |
input_path = f'skins/{skin_id}.png'
|
|
|
|
| 4 |
import subprocess
|
| 5 |
from concurrent.futures import ThreadPoolExecutor
|
| 6 |
|
| 7 |
+
output_dir = 'target_imgs_v95'
|
| 8 |
|
| 9 |
def process_skin(skin_id):
|
| 10 |
input_path = f'skins/{skin_id}.png'
|
control_imgs/0f2c9a15bd13b738.png
DELETED
Git LFS Details
|
control_imgs/12.png
DELETED
Git LFS Details
|
control_imgs/188486.png
DELETED
Git LFS Details
|
control_imgs/198224.png
DELETED
Git LFS Details
|
control_imgs/2c35b77ee2cdfd42.png
DELETED
Git LFS Details
|
control_imgs/386c002183750df9.png
DELETED
Git LFS Details
|
control_imgs/5002d28d665fc668.png
DELETED
Git LFS Details
|
control_imgs/509dd472891584c0.png
DELETED
Git LFS Details
|
control_imgs/517485.png
DELETED
Git LFS Details
|
control_imgs/519494.png
DELETED
Git LFS Details
|
control_imgs/525273.png
DELETED
Git LFS Details
|
control_imgs/538419.png
DELETED
Git LFS Details
|
control_imgs/553045.png
DELETED
Git LFS Details
|
control_imgs/560261.png
DELETED
Git LFS Details
|
control_imgs/64154.png
DELETED
Git LFS Details
|
control_imgs/64154f.png
DELETED
Git LFS Details
|
control_imgs/645888.png
DELETED
Git LFS Details
|
control_imgs/667114.png
DELETED
Git LFS Details
|
control_imgs/8880001.png
DELETED
Git LFS Details
|
control_imgs/8880002.png
DELETED
Git LFS Details
|
control_imgs/8880007.png
DELETED
Git LFS Details
|
control_imgs/8880011.png
DELETED
Git LFS Details
|
control_imgs/8880022.png
DELETED
Git LFS Details
|
control_imgs/8880022f.png
DELETED
Git LFS Details
|
control_imgs/8880023.png
DELETED
Git LFS Details
|
control_imgs/8880023f.png
DELETED
Git LFS Details
|
control_imgs/8880100.png
DELETED
Git LFS Details
|
control_imgs/8880106.png
DELETED
Git LFS Details
|
control_imgs/8880108.png
DELETED
Git LFS Details
|
control_imgs/8880200.png
DELETED
Git LFS Details
|
control_imgs/8880201.png
DELETED
Git LFS Details
|
control_imgs/8880400.png
DELETED
Git LFS Details
|
control_imgs/8880400f.png
DELETED
Git LFS Details
|
control_imgs/8880500.png
DELETED
Git LFS Details
|
control_imgs/8880501.png
DELETED
Git LFS Details
|
control_imgs/8880502.png
DELETED
Git LFS Details
|
control_imgs/8880503.png
DELETED
Git LFS Details
|
control_imgs/8880600.png
DELETED
Git LFS Details
|
control_imgs/8880602.png
DELETED
Git LFS Details
|
control_imgs/8880700.png
DELETED
Git LFS Details
|
control_imgs/8880800.png
DELETED
Git LFS Details
|
control_imgs/8880803.png
DELETED
Git LFS Details
|
control_imgs/8880810.png
DELETED
Git LFS Details
|
control_imgs/8880812.png
DELETED
Git LFS Details
|
control_imgs/8882000.png
DELETED
Git LFS Details
|
control_imgs/8882001.png
DELETED
Git LFS Details
|
control_imgs/9874eccccd0dc1c0.png
DELETED
Git LFS Details
|
control_imgs/a5c3a615940c35cf.png
DELETED
Git LFS Details
|