Sudipta Nayak commited on
Commit
668f0f4
·
1 Parent(s): d7fee5d
app/Hackathon_setup/face_recognition.py CHANGED
@@ -112,15 +112,16 @@ def get_face_class(img1):
112
  ##Hint: you need a classifier finetuned for your classes, it takes o/p of siamese as i/p to it
113
  ##Better Hint: Siamese experiment is covered in one of the labs
114
 
115
- transform = transforms.Compose([
116
- transforms.Grayscale(num_output_channels = 1),
117
- transforms.Resize((100, 100)), # Resize the image to the desired size
118
- transforms.ToTensor(), # Convert the image to a PyTorch tensor
119
- transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]) # Normalize if needed
120
- ])
121
-
 
122
  # Apply the transformations to the image
123
- det_img1_tensor = transform(det_img1)
124
 
125
  feature_net = SiameseNetwork() #Example Network
126
  feature_net = feature_net.to(device)
 
112
  ##Hint: you need a classifier finetuned for your classes, it takes o/p of siamese as i/p to it
113
  ##Better Hint: Siamese experiment is covered in one of the labs
114
 
115
+ # transform = transforms.Compose([
116
+ # transforms.Grayscale(num_output_channels = 1),
117
+ # transforms.Resize((100, 100)), # Resize the image to the desired size
118
+ # transforms.ToTensor(), # Convert the image to a PyTorch tensor
119
+ # transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]) # Normalize if needed
120
+ # ])
121
+ trnscm = transforms.Compose([transforms.Resize((100,100)), transforms.ToTensor()])
122
+ det_img1_tensor = trnscm(det_img1).unsqueeze(0)
123
  # Apply the transformations to the image
124
+ # det_img1_tensor = transform(det_img1)
125
 
126
  feature_net = SiameseNetwork() #Example Network
127
  feature_net = feature_net.to(device)