File size: 950 Bytes
9894d76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.PHONY: baseline help copy-label-studio-images train

help:
	@echo "Available targets:"
	@echo "  baseline              - Run the baseline NSFW detection script"
	@echo "  copy-label-studio-images - Copy annotated images from Label Studio"
	@echo "  train                 - Train the model"
	@echo "  help                  - Show this help message"

baseline:
	uv run python src/baseline.py

copy-label-studio-images:
	uv run python -c "import json, shutil; from pathlib import Path; from rich import print; ls_media = Path.home() / 'Library/Application Support/label-studio/media/upload/5'; project_imgs = Path('data/imgs'); anns = json.load(open('data/annotations.json')); files = [a['file_upload'] for a in anns if a.get('file_upload')]; [shutil.copy2(ls_media / f, project_imgs / f) for f in files if (ls_media / f).exists()]; print(f'✓ Copied {sum(1 for f in files if (project_imgs / f).exists())} images')"

train:
	uv run python -m src.train