Datasets:
EntropyDrop commited on
Commit ·
586a73f
1
Parent(s): ade0be5
update
Browse files- DDJ_real2render/create_template.py +4 -4
- DDJ_real2render/real2render.py +2 -2
- DDJ_real2render/template/template17.png +3 -0
- DDJ_real2render/test_batch.sh +2 -2
- DDJ_real2render/test_output/img15_template14_template16.png +3 -0
- DDJ_real2render/test_output/img15_template17.png +3 -0
- DDJ_real2render/test_output/img16_template14_template16.png +3 -0
- DDJ_real2render/test_output/img16_template17.png +3 -0
- DDJ_real2render/test_output/img17_template14_template16.png +3 -0
- DDJ_real2render/test_output/img17_template17.png +3 -0
DDJ_real2render/create_template.py
CHANGED
|
@@ -28,7 +28,7 @@ def parse_bg_color(bg_color):
|
|
| 28 |
|
| 29 |
def create_template(skin_path, output_path, renderer_path, size="512x1024", bg_color="black"):
|
| 30 |
"""
|
| 31 |
-
Renders
|
| 32 |
using PyVista, merges them horizontally, adds background color, and saves the result to output_path.
|
| 33 |
|
| 34 |
:param skin_path: Path to the input skin PNG image.
|
|
@@ -72,7 +72,7 @@ def create_template(skin_path, output_path, renderer_path, size="512x1024", bg_c
|
|
| 72 |
|
| 73 |
views_config = get_views(target_size)
|
| 74 |
|
| 75 |
-
view_names = ["
|
| 76 |
rendered_images = {}
|
| 77 |
|
| 78 |
for view_name in view_names:
|
|
@@ -101,8 +101,8 @@ def create_template(skin_path, output_path, renderer_path, size="512x1024", bg_c
|
|
| 101 |
)
|
| 102 |
rendered_images[view_name] = Image.fromarray(pv_render)
|
| 103 |
|
| 104 |
-
front_img = rendered_images["
|
| 105 |
-
back_img = rendered_images["
|
| 106 |
|
| 107 |
if merge is not None:
|
| 108 |
merged_img = merge(front_img, back_img, direction="horizontal")
|
|
|
|
| 28 |
|
| 29 |
def create_template(skin_path, output_path, renderer_path, size="512x1024", bg_color="black"):
|
| 30 |
"""
|
| 31 |
+
Renders front1 and back1 views for a given skin
|
| 32 |
using PyVista, merges them horizontally, adds background color, and saves the result to output_path.
|
| 33 |
|
| 34 |
:param skin_path: Path to the input skin PNG image.
|
|
|
|
| 72 |
|
| 73 |
views_config = get_views(target_size)
|
| 74 |
|
| 75 |
+
view_names = ["front1", "back1"]
|
| 76 |
rendered_images = {}
|
| 77 |
|
| 78 |
for view_name in view_names:
|
|
|
|
| 101 |
)
|
| 102 |
rendered_images[view_name] = Image.fromarray(pv_render)
|
| 103 |
|
| 104 |
+
front_img = rendered_images["front1"]
|
| 105 |
+
back_img = rendered_images["back1"]
|
| 106 |
|
| 107 |
if merge is not None:
|
| 108 |
merged_img = merge(front_img, back_img, direction="horizontal")
|
DDJ_real2render/real2render.py
CHANGED
|
@@ -12,9 +12,9 @@ DEFAULT_TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
|
| 12 |
# Default prompt for real-to-render Minecraft character generation
|
| 13 |
DEFAULT_PROMPT = """生成[图1]中角色的Minecraft形象
|
| 14 |
|
| 15 |
-
- 人物模型必须与minecraft的玩家模型相同,且为包含内层/外层贴图的双图层模型,不能有额外元素。
|
| 16 |
|
| 17 |
-
- 生成的minecraft角色的姿势与[图2]完全一致
|
| 18 |
|
| 19 |
- 使用容易区分前景的纯色背景。
|
| 20 |
|
|
|
|
| 12 |
# Default prompt for real-to-render Minecraft character generation
|
| 13 |
DEFAULT_PROMPT = """生成[图1]中角色的Minecraft形象
|
| 14 |
|
| 15 |
+
- 人物模型必须与minecraft的玩家模型相同,且为包含内层/外层贴图的双图层模型,不能有额外元素。texture不能高于Minecraft所支持的分辨率。模型参考[图2]和[图3]
|
| 16 |
|
| 17 |
+
- 生成的minecraft角色的尺寸、朝向、姿势与[图2]完全一致,且必须包含正面图与背面图,并排放置。
|
| 18 |
|
| 19 |
- 使用容易区分前景的纯色背景。
|
| 20 |
|
DDJ_real2render/template/template17.png
ADDED
|
Git LFS Details
|
DDJ_real2render/test_batch.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
template_x=${template_x:-
|
| 2 |
template_y=${template_y:-template16}
|
| 3 |
|
| 4 |
-
for i in {
|
| 5 |
if [ -f "test_input/img${i}.png" ]; then
|
| 6 |
img_file="test_input/img${i}.png"
|
| 7 |
elif [ -f "test_input/img${i}.jpg" ]; then
|
|
|
|
| 1 |
+
template_x=${template_x:-template14}
|
| 2 |
template_y=${template_y:-template16}
|
| 3 |
|
| 4 |
+
for i in {15..17}; do
|
| 5 |
if [ -f "test_input/img${i}.png" ]; then
|
| 6 |
img_file="test_input/img${i}.png"
|
| 7 |
elif [ -f "test_input/img${i}.jpg" ]; then
|
DDJ_real2render/test_output/img15_template14_template16.png
ADDED
|
Git LFS Details
|
DDJ_real2render/test_output/img15_template17.png
ADDED
|
Git LFS Details
|
DDJ_real2render/test_output/img16_template14_template16.png
ADDED
|
Git LFS Details
|
DDJ_real2render/test_output/img16_template17.png
ADDED
|
Git LFS Details
|
DDJ_real2render/test_output/img17_template14_template16.png
ADDED
|
Git LFS Details
|
DDJ_real2render/test_output/img17_template17.png
ADDED
|
Git LFS Details
|