Instructions to use haresh2792005/MFAF-Net with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MediaPipe
How to use haresh2792005/MFAF-Net with MediaPipe:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download extract_dataset.py from haresh2792005/MFAF-Net: direct link, hf CLI and curl.
- Browser
- Download file 2.84 kB
-
https://huggingface.co/haresh2792005/MFAF-Net/resolve/main/extract_dataset.py
- Command line
-
hf download hf://haresh2792005/MFAF-Net/extract_dataset.py
-
curl -L -o extract_dataset.py https://huggingface.co/haresh2792005/MFAF-Net/resolve/main/extract_dataset.py
2.84 kB
| """ | |
| extract_dataset.py — MFAF-Net Dataset Extraction Utility | |
| Extracts Complete_PlasticSurgery_Datasets.zip into the `data/` directory | |
| and prints an extraction summary including procedure subfolders and metadata. | |
| Usage: | |
| python extract_dataset.py [path_to_zip] | |
| """ | |
| import os | |
| import sys | |
| import zipfile | |
| DEFAULT_ZIP_PATHS = [ | |
| r'C:\Users\ARUL RAJ HARESH\Downloads\Complete_PlasticSurgery_Datasets.zip', | |
| os.path.join(os.path.dirname(__file__), 'Complete_PlasticSurgery_Datasets.zip'), | |
| os.path.join(os.path.dirname(__file__), 'data', 'Complete_PlasticSurgery_Datasets.zip'), | |
| ] | |
| TARGET_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') | |
| def find_zip(): | |
| if len(sys.argv) > 1 and os.path.isfile(sys.argv[1]): | |
| return sys.argv[1] | |
| for p in DEFAULT_ZIP_PATHS: | |
| if os.path.isfile(p): | |
| return p | |
| return None | |
| def extract(): | |
| print("=" * 60) | |
| print("MFAF-Net — Complete Plastic Surgery Dataset Extraction") | |
| print("=" * 60) | |
| zip_path = find_zip() | |
| if not zip_path: | |
| print("[ERROR] Complete_PlasticSurgery_Datasets.zip not found.") | |
| print("Looked in:") | |
| for p in DEFAULT_ZIP_PATHS: | |
| print(f" - {p}") | |
| print("\nPlease specify the zip path:") | |
| print(" python extract_dataset.py <path_to_zip>") | |
| sys.exit(1) | |
| print(f"Found archive: {zip_path}") | |
| print(f"Archive size: {os.path.getsize(zip_path) / (1024*1024):.2f} MB") | |
| print(f"Extracting to: {TARGET_DIR}") | |
| os.makedirs(TARGET_DIR, exist_ok=True) | |
| with zipfile.ZipFile(zip_path, 'r') as z: | |
| names = z.namelist() | |
| total = len(names) | |
| print(f"Total entries in archive: {total}") | |
| # Analyze directory breakdown | |
| folders = {} | |
| for n in names: | |
| parts = n.strip('/').split('/') | |
| top = '/'.join(parts[:2]) if len(parts) > 1 else parts[0] | |
| folders[top] = folders.get(top, 0) + 1 | |
| print("\nArchive contents overview:") | |
| for k, v in sorted(folders.items())[:20]: | |
| print(f" {v:5d} entries {k}") | |
| if len(folders) > 20: | |
| print(f" ... and {len(folders) - 20} more subdirectories") | |
| print("\nExtracting files...") | |
| z.extractall(TARGET_DIR) | |
| print("Extracted successfully!") | |
| print("\nVerifying extraction in:", TARGET_DIR) | |
| extracted_items = os.listdir(TARGET_DIR) | |
| print(f"Top-level items in data/ ({len(extracted_items)} items):") | |
| for item in sorted(extracted_items)[:30]: | |
| item_path = os.path.join(TARGET_DIR, item) | |
| kind = "DIR " if os.path.isdir(item_path) else "FILE" | |
| print(f" [{kind}] {item}") | |
| print("\nDataset ready for MFAF-Net pipeline.") | |
| print("Run `python -m mfaf_net.dataset_analysis` to inspect details.") | |
| if __name__ == '__main__': | |
| extract() | |