Skip to content

Commit

Permalink
pml 2.3.0 and review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanbsolak committed Dec 12, 2023
1 parent 618faf8 commit 03c1e99
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3340,7 +3340,7 @@ Additional information about the evaluation kits, and the software development k
[AHB Addresses for MAX78000 and MAX78002](docs/AHBAddresses.md)
[Facial Recognition System](docs/FacialRecognitionSystem.md)
[Facial Recognition System](https://github.com/MaximIntegratedAI/ai8x-training/blob/develop/docs/FacialRecognitionSystem.md)
---
Expand Down
15 changes: 12 additions & 3 deletions datasets/vggface2.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ def __len__(self):
return len(self.pickle_dict["img_list"]) - 1

def __getitem__(self, index):
"""
Get the image and associated target according to the mode
"""
if index >= len(self):
raise IndexError

Expand All @@ -157,7 +160,9 @@ def __getitem__(self, index):
return None

def __getitem_detection(self, index):

"""
Get the image and associated target for face detection
"""
if torch.is_tensor(index):
index = index.tolist()

Expand All @@ -181,7 +186,9 @@ def __getitem_detection(self, index):
return img, (boxes, labels)

def __getitem_identification(self, index):

"""
Get the image and associated target for face identification
"""
if torch.is_tensor(index):
index = index.tolist()

Expand Down Expand Up @@ -246,7 +253,9 @@ def __getitem_identification(self, index):
return concat_img, lbl_index

def __getitem_identification_dr(self, index):

"""
Get the image and associated target for dimensionality reduction
"""
if torch.is_tensor(index):
index = index.tolist()

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ albumentations>=1.3.0
pytube>=12.1.3
pyffmpeg==2.0
GitPython>=3.1.18
pytorch-metric-learning==1.6.3
pytorch-metric-learning==2.3.0
faiss-cpu==1.7.4
hawk-eyes==2.1.2
onnx==1.14.1
onnx==1.15.0
onnxruntime-gpu==1.10.0
imutils==0.5.4
-e distiller
2 changes: 1 addition & 1 deletion scripts/train_facedet_tinierssd.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
python train.py --deterministic --print-freq 100 --epochs 3 --optimizer Adam --lr 1e-3 --wd 5e-4 --model ai85tinierssdface --use-bias --momentum 0.9 --dataset VGGFace2_FaceDetection --device MAX78000 --obj-detection --obj-detection-params parameters/obj_detection_params_facedet.yaml --batch-size 100 --qat-policy policies/qat_policy_facedet.yaml --validation-split 0.1 --gpus 1 "$@"
python train.py --deterministic --print-freq 100 --epochs 3 --optimizer Adam --lr 1e-3 --wd 5e-4 --model ai85tinierssdface --use-bias --momentum 0.9 --dataset VGGFace2_FaceDetection --device MAX78000 --obj-detection --obj-detection-params parameters/obj_detection_params_facedet.yaml --batch-size 100 --qat-policy policies/qat_policy_facedet.yaml --validation-split 0.1 "$@"
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ def scaf_test(val_loader, model, accuracy_calculator):
test_embeddings, test_labels = get_all_embeddings(val_loader.dataset, model)
test_labels = test_labels.squeeze(1)
accuracies = accuracy_calculator.get_accuracy(
test_embeddings, test_embeddings, test_labels, test_labels, True
test_embeddings, test_labels, None, None, True
)
msglogger.info('Test set accuracy (Precision@1) = %f', accuracies['precision_at_1'])
return accuracies["precision_at_1"], 0, 0, 0
Expand Down

0 comments on commit 03c1e99

Please sign in to comment.