mirror of
https://github.com/yakhyo/uniface.git
synced 2025-12-30 09:02:25 +00:00
- add dynamic onnx provider selection for m1/m2/m3/m4 macs - replace mkdocs with simple markdown files - fix model download and scrfd detection issues - update ci/cd workflows
32 lines
937 B
Python
32 lines
937 B
Python
import argparse
|
|
from uniface.constants import RetinaFaceWeights
|
|
from uniface.model_store import verify_model_weights
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description="Download and verify RetinaFace model weights.")
|
|
parser.add_argument(
|
|
"--model",
|
|
type=str,
|
|
choices=[m.name for m in RetinaFaceWeights],
|
|
help="Model to download (e.g. MNET_V2). If not specified, all models will be downloaded.",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
if args.model:
|
|
weight = RetinaFaceWeights[args.model]
|
|
print(f"📥 Downloading model: {weight.value}")
|
|
verify_model_weights(weight) # Pass enum, not string
|
|
else:
|
|
print("📥 Downloading all models...")
|
|
for weight in RetinaFaceWeights:
|
|
verify_model_weights(weight) # Pass enum, not string
|
|
|
|
print("✅ All requested weights are ready and verified.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|
|
|