Datasets:
EntropyDrop commited on
Commit ·
73a9705
1
Parent(s): 01679af
update
Browse files- .gitignore +1 -0
- skins/0a21e66dd70f6edc.png → control_imgs/back/2d2e43a0dfaef1e7.png +2 -2
- skins/0f7d149545431a8b.png → control_imgs/back/4b269d1465f8ae2b.png +2 -2
- skins/3dad5e769ea6f992.png → control_imgs/back/82003b68ac565c30.png +2 -2
- skins/4009ac086d910cd0.png → control_imgs/back/d8a6aa5b94cbddda.png +2 -2
- control_imgs/back/e14cc218e86d20c7.png +3 -0
- {skins → control_imgs/back}/f460c219216455e4.png +2 -2
- control_imgs/front/2d2e43a0dfaef1e7.png +3 -0
- control_imgs/front/4b269d1465f8ae2b.png +3 -0
- control_imgs/front/82003b68ac565c30.png +3 -0
- control_imgs/front/d8a6aa5b94cbddda.png +3 -0
- control_imgs/front/e14cc218e86d20c7.png +3 -0
- gpt_skin2real_auto.py +26 -6
- skins/48267dc651d6765b.png +0 -3
- skins/5d25747c5a542d06.png +0 -3
- skins/add3f55a8eac224a.png +0 -3
- skins/b0803700648041c1.png +0 -3
- skins/c74430a976a62bd3.png +0 -3
- skins/da745147f2294b01.png +0 -3
- skins/efa527b0fe6c9013.png +0 -3
- skins/f6570156f010f493.png +0 -3
.gitignore
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
preserved
|
| 2 |
__pycache__
|
| 3 |
.env
|
|
|
|
|
|
| 1 |
preserved
|
| 2 |
__pycache__
|
| 3 |
.env
|
| 4 |
+
.DS_Store
|
skins/0a21e66dd70f6edc.png → control_imgs/back/2d2e43a0dfaef1e7.png
RENAMED
|
File without changes
|
skins/0f7d149545431a8b.png → control_imgs/back/4b269d1465f8ae2b.png
RENAMED
|
File without changes
|
skins/3dad5e769ea6f992.png → control_imgs/back/82003b68ac565c30.png
RENAMED
|
File without changes
|
skins/4009ac086d910cd0.png → control_imgs/back/d8a6aa5b94cbddda.png
RENAMED
|
File without changes
|
control_imgs/back/e14cc218e86d20c7.png
ADDED
|
Git LFS Details
|
{skins → control_imgs/back}/f460c219216455e4.png
RENAMED
|
File without changes
|
control_imgs/front/2d2e43a0dfaef1e7.png
ADDED
|
Git LFS Details
|
control_imgs/front/4b269d1465f8ae2b.png
ADDED
|
Git LFS Details
|
control_imgs/front/82003b68ac565c30.png
ADDED
|
Git LFS Details
|
control_imgs/front/d8a6aa5b94cbddda.png
ADDED
|
Git LFS Details
|
control_imgs/front/e14cc218e86d20c7.png
ADDED
|
Git LFS Details
|
gpt_skin2real_auto.py
CHANGED
|
@@ -9,12 +9,17 @@ from convert_skin import convert_skin_64x32_to_64x64
|
|
| 9 |
def main():
|
| 10 |
skins_dir = "skins"
|
| 11 |
control_imgs_dir = "control_imgs"
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
if not os.path.exists(skins_dir):
|
| 14 |
print(f"Error: Skins directory '{skins_dir}' does not exist.")
|
| 15 |
sys.exit(1)
|
| 16 |
|
| 17 |
-
os.makedirs(
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# List all PNG files in skins
|
| 20 |
skin_files = [f for f in os.listdir(skins_dir) if f.lower().endswith(".png")]
|
|
@@ -40,10 +45,12 @@ def main():
|
|
| 40 |
|
| 41 |
for skin_file in skin_files:
|
| 42 |
skin_path = os.path.join(skins_dir, skin_file)
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
# Check if the output control
|
| 46 |
-
if os.path.exists(
|
| 47 |
skipped += 1
|
| 48 |
continue
|
| 49 |
|
|
@@ -61,12 +68,25 @@ def main():
|
|
| 61 |
continue
|
| 62 |
|
| 63 |
# Invoke gpt_skin2real.py using subprocess
|
| 64 |
-
cmd = [sys.executable, "gpt_skin2real.py", skin_path, "-o",
|
| 65 |
print(f"[*] Running command: {' '.join(cmd)}")
|
| 66 |
try:
|
| 67 |
# We run the command and check for success. If it fails, we output the error but continue to other skins.
|
| 68 |
subprocess.run(cmd, check=True)
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
processed += 1
|
| 71 |
except subprocess.CalledProcessError as e:
|
| 72 |
print(f"[!] Command failed for {skin_file}: {e}")
|
|
|
|
| 9 |
def main():
|
| 10 |
skins_dir = "skins"
|
| 11 |
control_imgs_dir = "control_imgs"
|
| 12 |
+
tmp_dir = os.path.join(control_imgs_dir, "tmp")
|
| 13 |
+
front_dir = os.path.join(control_imgs_dir, "front")
|
| 14 |
+
back_dir = os.path.join(control_imgs_dir, "back")
|
| 15 |
|
| 16 |
if not os.path.exists(skins_dir):
|
| 17 |
print(f"Error: Skins directory '{skins_dir}' does not exist.")
|
| 18 |
sys.exit(1)
|
| 19 |
|
| 20 |
+
os.makedirs(tmp_dir, exist_ok=True)
|
| 21 |
+
os.makedirs(front_dir, exist_ok=True)
|
| 22 |
+
os.makedirs(back_dir, exist_ok=True)
|
| 23 |
|
| 24 |
# List all PNG files in skins
|
| 25 |
skin_files = [f for f in os.listdir(skins_dir) if f.lower().endswith(".png")]
|
|
|
|
| 45 |
|
| 46 |
for skin_file in skin_files:
|
| 47 |
skin_path = os.path.join(skins_dir, skin_file)
|
| 48 |
+
front_path = os.path.join(front_dir, skin_file)
|
| 49 |
+
back_path = os.path.join(back_dir, skin_file)
|
| 50 |
+
tmp_output_path = os.path.join(tmp_dir, skin_file)
|
| 51 |
|
| 52 |
+
# Check if the output control images (front and back) already exist
|
| 53 |
+
if os.path.exists(front_path) and os.path.exists(back_path):
|
| 54 |
skipped += 1
|
| 55 |
continue
|
| 56 |
|
|
|
|
| 68 |
continue
|
| 69 |
|
| 70 |
# Invoke gpt_skin2real.py using subprocess
|
| 71 |
+
cmd = [sys.executable, "gpt_skin2real.py", skin_path, "-o", tmp_output_path]
|
| 72 |
print(f"[*] Running command: {' '.join(cmd)}")
|
| 73 |
try:
|
| 74 |
# We run the command and check for success. If it fails, we output the error but continue to other skins.
|
| 75 |
subprocess.run(cmd, check=True)
|
| 76 |
+
|
| 77 |
+
# Split the generated image into front and back
|
| 78 |
+
with Image.open(tmp_output_path) as img:
|
| 79 |
+
width, height = img.size
|
| 80 |
+
left_half = img.crop((0, 0, width // 2, height))
|
| 81 |
+
right_half = img.crop((width // 2, 0, width, height))
|
| 82 |
+
left_half.save(front_path)
|
| 83 |
+
right_half.save(back_path)
|
| 84 |
+
|
| 85 |
+
# Clean up the temporary file in control_imgs/tmp
|
| 86 |
+
if os.path.exists(tmp_output_path):
|
| 87 |
+
os.remove(tmp_output_path)
|
| 88 |
+
|
| 89 |
+
print(f"[+] Completed: {skin_file} -> {front_path} and {back_path}")
|
| 90 |
processed += 1
|
| 91 |
except subprocess.CalledProcessError as e:
|
| 92 |
print(f"[!] Command failed for {skin_file}: {e}")
|
skins/48267dc651d6765b.png
DELETED
Git LFS Details
|
skins/5d25747c5a542d06.png
DELETED
Git LFS Details
|
skins/add3f55a8eac224a.png
DELETED
Git LFS Details
|
skins/b0803700648041c1.png
DELETED
Git LFS Details
|
skins/c74430a976a62bd3.png
DELETED
Git LFS Details
|
skins/da745147f2294b01.png
DELETED
Git LFS Details
|
skins/efa527b0fe6c9013.png
DELETED
Git LFS Details
|
skins/f6570156f010f493.png
DELETED
Git LFS Details
|