Datasets:
EntropyDrop commited on
Commit ·
544fd79
1
Parent(s): 32c2f4f
v92
Browse files- build_target_img.py +2 -2
- build_target_imgs.py +2 -2
- mc_render.py +7 -1
build_target_img.py
CHANGED
|
@@ -137,7 +137,7 @@ def create_training_image(skin_image):
|
|
| 137 |
r_scale4 = 0.25
|
| 138 |
full_part = ['head','body','left_arm','right_arm','left_leg','right_leg']
|
| 139 |
|
| 140 |
-
limbs_offset = 0.
|
| 141 |
default_pos_args = {
|
| 142 |
'head': (0, 28, 0),
|
| 143 |
'body': (0, 18, 0),
|
|
@@ -191,7 +191,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,
|
|
|
|
| 137 |
r_scale4 = 0.25
|
| 138 |
full_part = ['head','body','left_arm','right_arm','left_leg','right_leg']
|
| 139 |
|
| 140 |
+
limbs_offset = 0.0
|
| 141 |
default_pos_args = {
|
| 142 |
'head': (0, 28, 0),
|
| 143 |
'body': (0, 18, 0),
|
|
|
|
| 191 |
output_size=render_size,
|
| 192 |
cam_front=cam_front,
|
| 193 |
look_at_y=look_at_y,
|
| 194 |
+
use_voxels=False,
|
| 195 |
ortho=ortho,
|
| 196 |
core_display=core_display,
|
| 197 |
decor_display=decor_display,
|
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, skin_style):
|
| 10 |
input_path = f'skins/{skin_style}/{skin_id}.png'
|
|
@@ -53,4 +53,4 @@ def main():
|
|
| 53 |
sorted(list(iset))
|
| 54 |
)
|
| 55 |
if __name__ == '__main__':
|
| 56 |
-
main()
|
|
|
|
| 4 |
import subprocess
|
| 5 |
from concurrent.futures import ThreadPoolExecutor
|
| 6 |
|
| 7 |
+
output_dir = 'target_imgs_v92'
|
| 8 |
|
| 9 |
def process_skin(skin_id, skin_style):
|
| 10 |
input_path = f'skins/{skin_style}/{skin_id}.png'
|
|
|
|
| 53 |
sorted(list(iset))
|
| 54 |
)
|
| 55 |
if __name__ == '__main__':
|
| 56 |
+
main()
|
mc_render.py
CHANGED
|
@@ -90,6 +90,12 @@ def create_textured_box(
|
|
| 90 |
colors = face_tex.reshape(-1, 4)
|
| 91 |
plane.cell_data["RGBA"] = colors.astype(np.uint8)
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
# 6. Move and rotate the plane to the correct position
|
| 94 |
# Note: rotate operation modifies points in place
|
| 95 |
if name == 'front': # +Z
|
|
@@ -400,7 +406,7 @@ def build_minecraft_model(
|
|
| 400 |
) -> list:
|
| 401 |
"""Build the model components."""
|
| 402 |
scale = 1.0
|
| 403 |
-
limbs_offset = 0.
|
| 404 |
|
| 405 |
is_slim = skin[52, 47, 3] == 0
|
| 406 |
|
|
|
|
| 90 |
colors = face_tex.reshape(-1, 4)
|
| 91 |
plane.cell_data["RGBA"] = colors.astype(np.uint8)
|
| 92 |
|
| 93 |
+
# Filter out transparent cells (alpha < 10) to avoid occlusion/depth-writing issues
|
| 94 |
+
non_transparent_indices = np.where(colors[:, 3] >= 10)[0]
|
| 95 |
+
if len(non_transparent_indices) == 0:
|
| 96 |
+
return None
|
| 97 |
+
plane = plane.extract_cells(non_transparent_indices)
|
| 98 |
+
|
| 99 |
# 6. Move and rotate the plane to the correct position
|
| 100 |
# Note: rotate operation modifies points in place
|
| 101 |
if name == 'front': # +Z
|
|
|
|
| 406 |
) -> list:
|
| 407 |
"""Build the model components."""
|
| 408 |
scale = 1.0
|
| 409 |
+
limbs_offset = 0.0
|
| 410 |
|
| 411 |
is_slim = skin[52, 47, 3] == 0
|
| 412 |
|