sczhou commited on
Commit
8e5f81b
·
1 Parent(s): fa547b7

fix pytorch version check.

Browse files
README.md CHANGED
@@ -136,7 +136,7 @@ If our work is useful for your research, please consider citing:
136
 
137
  ### License
138
 
139
- This project is licensed under <a rel="license" href="https://github.com/sczhou/CodeFormer/blob/master/LICENSE">S-Lab License 1.0</a>. Redistribution and use for non-commercial purposes should follow this license.
140
 
141
  ### Acknowledgement
142
 
 
136
 
137
  ### License
138
 
139
+ This project is licensed under <a rel="license" href="https://github.com/sczhou/CodeFormer/blob/master/LICENSE">NTU S-Lab License 1.0</a>. Redistribution and use should follow this license.
140
 
141
  ### Acknowledgement
142
 
basicsr/archs/vqgan_arch.py CHANGED
@@ -41,10 +41,10 @@ class VectorQuantizer(nn.Module):
41
 
42
  mean_distance = torch.mean(d)
43
  # find closest encodings
44
- # min_encoding_indices = torch.argmin(d, dim=1).unsqueeze(1)
45
- min_encoding_scores, min_encoding_indices = torch.topk(d, 1, dim=1, largest=False)
46
  # [0-1], higher score, higher confidence
47
- min_encoding_scores = torch.exp(-min_encoding_scores/10)
48
 
49
  min_encodings = torch.zeros(min_encoding_indices.shape[0], self.codebook_size).to(z)
50
  min_encodings.scatter_(1, min_encoding_indices, 1)
@@ -66,7 +66,6 @@ class VectorQuantizer(nn.Module):
66
  "perplexity": perplexity,
67
  "min_encodings": min_encodings,
68
  "min_encoding_indices": min_encoding_indices,
69
- "min_encoding_scores": min_encoding_scores,
70
  "mean_distance": mean_distance
71
  }
72
 
 
41
 
42
  mean_distance = torch.mean(d)
43
  # find closest encodings
44
+ min_encoding_indices = torch.argmin(d, dim=1).unsqueeze(1)
45
+ # min_encoding_scores, min_encoding_indices = torch.topk(d, 1, dim=1, largest=False)
46
  # [0-1], higher score, higher confidence
47
+ # min_encoding_scores = torch.exp(-min_encoding_scores/10)
48
 
49
  min_encodings = torch.zeros(min_encoding_indices.shape[0], self.codebook_size).to(z)
50
  min_encodings.scatter_(1, min_encoding_indices, 1)
 
66
  "perplexity": perplexity,
67
  "min_encodings": min_encodings,
68
  "min_encoding_indices": min_encoding_indices,
 
69
  "mean_distance": mean_distance
70
  }
71
 
facelib/detection/yolov5face/face_detector.py CHANGED
@@ -17,7 +17,7 @@ from facelib.detection.yolov5face.utils.general import (
17
  scale_coords_landmarks,
18
  )
19
 
20
- IS_HIGH_VERSION = tuple(map(int, torch.__version__.split('+')[0].split('.')[:3])) >= (1, 9, 0)
21
 
22
 
23
  def isListempty(inList):
 
17
  scale_coords_landmarks,
18
  )
19
 
20
+ IS_HIGH_VERSION = tuple(map(int, torch.__version__.split('+')[0].split('.')[:2])) >= (1, 9, 0)
21
 
22
 
23
  def isListempty(inList):