File size: 1,453 Bytes
3828719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import json
import os
from pathlib import Path

def check_sprite_descriptions():
    # Load the metadata JSON
    with open('sprite_dataset/sprite_metadata.json', 'r') as f:
        metadata = json.load(f)
    
    # Get the images root directory
    images_dir = Path('images')
    
    # Keep track of mismatches
    mismatches = []
    missing_folders = []
    
    # Check each sprite in metadata
    for sprite_id, sprite_info in metadata.items():
        expected_frames = int(sprite_info['frames'])
        # Use new folder naming scheme: [number]_frames
        sprite_folder = images_dir / f"{sprite_id}_frames"
        
        # Check if folder exists
        if not sprite_folder.exists():
            missing_folders.append({
                'sprite_id': sprite_id,
                'expected_folder': f"{sprite_id}_frames",
                'description': sprite_info['full_description']
            })
            continue
            
        # Count actual frames in folder
        actual_frames = len(list(sprite_folder.glob('*.png')))
        
        # Compare expected vs actual frames
        if expected_frames != actual_frames:
            mismatches.append({
                'sprite_id': sprite_id,
                'folder_name': f"{sprite_id}_frames",
                'expected_frames': expected_frames,
                'actual_frames': actual_frames,
                'description': sprite_info['full_description']
            })