Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -12,7 +12,7 @@ import random
|
|
12 |
import argparse # λͺ
λ Ήν μΈμλ₯Ό νμ±ν΄μ£Όλ λͺ¨λ
|
13 |
import numpy as np
|
14 |
from tqdm import tqdm # μμ
μ§νλ₯ νμνλ λΌμ΄λΈλ¬λ¦¬
|
15 |
-
|
16 |
import torch # νμ΄ν μΉ
|
17 |
import torch.nn as nn # ν΄λμ€ # attribute λ₯Ό νμ©ν΄ state λ₯Ό μ μ₯νκ³ νμ©
|
18 |
import torch.nn.functional as F # ν¨μ # μΈμ€ν΄μ€νμν¬ νμμμ΄ μ¬μ© κ°λ₯
|
@@ -154,8 +154,8 @@ def evaluate(model, dset_loader, criterion, is_print=False):
|
|
154 |
# 'prediction': prediction,
|
155 |
# 'confidence': confidence
|
156 |
# })
|
157 |
-
|
158 |
-
|
159 |
|
160 |
if is_print:
|
161 |
print()
|
|
|
12 |
import argparse # λͺ
λ Ήν μΈμλ₯Ό νμ±ν΄μ£Όλ λͺ¨λ
|
13 |
import numpy as np
|
14 |
from tqdm import tqdm # μμ
μ§νλ₯ νμνλ λΌμ΄λΈλ¬λ¦¬
|
15 |
+
import csv
|
16 |
import torch # νμ΄ν μΉ
|
17 |
import torch.nn as nn # ν΄λμ€ # attribute λ₯Ό νμ©ν΄ state λ₯Ό μ μ₯νκ³ νμ©
|
18 |
import torch.nn.functional as F # ν¨μ # μΈμ€ν΄μ€νμν¬ νμμμ΄ μ¬μ© κ°λ₯
|
|
|
154 |
# 'prediction': prediction,
|
155 |
# 'confidence': confidence
|
156 |
# })
|
157 |
+
open("/home/user/app/result/ho.txt", 'a') as f
|
158 |
+
f.writelines(prediction+'\n')
|
159 |
|
160 |
if is_print:
|
161 |
print()
|