Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,8 +122,9 @@ def real_fake_check(list_dir, path, model):
|
|
| 122 |
input_data = torch.tensor(input_data).unsqueeze(0).to('cpu')
|
| 123 |
result = model(input_data.float())
|
| 124 |
probabilities = F.softmax(result, dim=1)
|
| 125 |
-
|
| 126 |
-
|
|
|
|
| 127 |
#porb.append(round(probabilities[0][1].item(),2))
|
| 128 |
predicted_class = 0 if probabilities[0][0] >= THRESHOLD else 1 # 확률값이 기준치보다 크다면 real, 아니면 fake
|
| 129 |
if predicted_class == 0:
|
|
|
|
| 122 |
input_data = torch.tensor(input_data).unsqueeze(0).to('cpu')
|
| 123 |
result = model(input_data.float())
|
| 124 |
probabilities = F.softmax(result, dim=1)
|
| 125 |
+
prob[i]='%.2f'%probabilities[0][1].item()
|
| 126 |
+
|
| 127 |
+
#prob[i]=round(probabilities[0][1].item(),2)
|
| 128 |
#porb.append(round(probabilities[0][1].item(),2))
|
| 129 |
predicted_class = 0 if probabilities[0][0] >= THRESHOLD else 1 # 확률값이 기준치보다 크다면 real, 아니면 fake
|
| 130 |
if predicted_class == 0:
|