FaceRec
FaceRec copied to clipboard
Transform model fine-tuning code to Python package
Transform the model fine-tuning code in the Jupyter notebook files into a Python package named deeptune to help people fine-tune and train models of siamese architecture.
-
Package Structure:
- Create
deeptunepackage with subdirectories:data,models,training,evaluation,utils, andcli. - Add
__init__.pyfiles to each subdirectory to make them sub-packages. - Add
config.pyfor configuration settings. - Add
requirements.txtto list dependencies.
- Create
-
CLI Support:
- Create
cli.pyinclisubdirectory to allow users to interact with the package through the command line. - Implement
evaluate_modelcommand to evaluate models.
- Create
-
Loss Functions:
- Implement Triplet Loss, ArcFace Loss, and Contrastive Loss in
training/losses.py.
- Implement Triplet Loss, ArcFace Loss, and Contrastive Loss in
-
Data Generators:
- Implement
TripletGeneratorintraining/data_generators.pyto generate triplets for the triplet loss function.
- Implement
-
Evaluation:
- Move
Model-Training/eval-mark-I.pytoevaluation/eval_mark_I.pyand update imports. - Move
Model-Training/Evaluate_model_1.ipynbtoevaluation/evaluate_model_1.ipynband update imports.
- Move
-
Documentation:
- Update
README.mdto include instructions for using the new Python package, CLI usage, and example code.
- Update
For more details, open the Copilot Workspace session.
Quality Gate failed
Failed conditions
3 Security Hotspots
0.0% Coverage on New Code (required ≥ 80%)