inserted memo
Browse files
test.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
import argparse
|
| 3 |
-
from turtle import end_fill
|
| 4 |
import torch
|
| 5 |
import time
|
| 6 |
import numpy as np
|
|
@@ -67,12 +66,13 @@ def linear_histogram_matching(content_tensor, style_tensor):
|
|
| 67 |
Return:
|
| 68 |
style_tensor (torch.FloatTensor): histogram matched Style Image
|
| 69 |
"""
|
| 70 |
-
|
| 71 |
for b in range(len(content_tensor)):
|
| 72 |
std_ct = []
|
| 73 |
std_st = []
|
| 74 |
mean_ct = []
|
| 75 |
mean_st = []
|
|
|
|
| 76 |
for c in range(len(content_tensor[b])):
|
| 77 |
std_ct.append(torch.var(content_tensor[b][c],unbiased = False))
|
| 78 |
mean_ct.append(torch.mean(content_tensor[b][c]))
|
|
|
|
| 1 |
import os
|
| 2 |
import argparse
|
|
|
|
| 3 |
import torch
|
| 4 |
import time
|
| 5 |
import numpy as np
|
|
|
|
| 66 |
Return:
|
| 67 |
style_tensor (torch.FloatTensor): histogram matched Style Image
|
| 68 |
"""
|
| 69 |
+
#for batch
|
| 70 |
for b in range(len(content_tensor)):
|
| 71 |
std_ct = []
|
| 72 |
std_st = []
|
| 73 |
mean_ct = []
|
| 74 |
mean_st = []
|
| 75 |
+
#for channel
|
| 76 |
for c in range(len(content_tensor[b])):
|
| 77 |
std_ct.append(torch.var(content_tensor[b][c],unbiased = False))
|
| 78 |
mean_ct.append(torch.mean(content_tensor[b][c]))
|