Download utils.py from carsten12/BodyScan: direct link, hf CLI and curl.
- Browser
- Download file 584 Bytes
-
https://huggingface.co/spaces/carsten12/BodyScan/resolve/main/utils.py
- Command line
-
hf download hf://spaces/carsten12/BodyScan/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/carsten12/BodyScan/resolve/main/utils.py
584 Bytes
| import os | |
| import json | |
| import numpy as np | |
| def load_json_flat(filename): | |
| """ | |
| Load a JSON file from the project root (flat structure). | |
| """ | |
| file_path = os.path.join(os.path.dirname(__file__), filename) | |
| with open(file_path, 'r') as f: | |
| return json.load(f) | |
| def compute_euclidean_distance(p1, p2): | |
| """ | |
| Simple Euclidean distance between two points. | |
| """ | |
| return np.linalg.norm(np.array(p1) - np.array(p2)) | |
| # Additional utility functions (if any) should be updated to remove SMPL-X specific logic. | |
| # For brevity, only core utilities are shown here. | |