Commit
•
699e3bc
1
Parent(s):
4afceb6
Update pipeline.py
Browse files- pipeline.py +1 -2
pipeline.py
CHANGED
@@ -4,7 +4,6 @@ import io
|
|
4 |
import base64
|
5 |
from torchvision import transforms
|
6 |
|
7 |
-
|
8 |
from pytorch_pretrained_biggan import BigGAN, one_hot_from_names, truncated_noise_sample
|
9 |
|
10 |
class PreTrainedPipeline():
|
@@ -34,7 +33,7 @@ class PreTrainedPipeline():
|
|
34 |
output = self.model(noise_vector, class_vector, self.truncation)
|
35 |
|
36 |
img = transforms.ToPILImage()(output[0])
|
37 |
-
buffer = BytesIO()
|
38 |
img.save(buffer, format="JPEG")
|
39 |
img_str = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
40 |
|
|
|
4 |
import base64
|
5 |
from torchvision import transforms
|
6 |
|
|
|
7 |
from pytorch_pretrained_biggan import BigGAN, one_hot_from_names, truncated_noise_sample
|
8 |
|
9 |
class PreTrainedPipeline():
|
|
|
33 |
output = self.model(noise_vector, class_vector, self.truncation)
|
34 |
|
35 |
img = transforms.ToPILImage()(output[0])
|
36 |
+
buffer = io.BytesIO()
|
37 |
img.save(buffer, format="JPEG")
|
38 |
img_str = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
39 |
|