Skip to content

Commit

Permalink
Merge pull request #106 from nakajima-john-shotaro/feature/backend/image
Browse files Browse the repository at this point in the history
Feature/backend/image
  • Loading branch information
nakajima-john-shotaro authored Oct 3, 2021
2 parents da48314 + 01e3bc2 commit 2789457
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aicon/backend/models/big_sleep/big_sleep.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def __init__(
gradient_accumulate_every: int = int(self.client_data[RECEIVED_DATA][JSON_GAE])
model_name: str = self.client_data[RECEIVED_DATA][JSON_BACKBONE]
if self.client_data[RECEIVED_DATA][JSON_SOURCE_IMG] is not None:
source_img: Image = Image.open(BytesIO(b64decode((self.client_data[RECEIVED_DATA][JSON_SOURCE_IMG]))))
source_img: Image = Image.open(BytesIO(b64decode((self.client_data[RECEIVED_DATA][JSON_SOURCE_IMG])))).convert('RGB')
else:
source_img = None

Expand Down
4 changes: 2 additions & 2 deletions aicon/backend/models/deep_daze/deep_daze.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def __init__(
self.start_image_lr: float = start_image_lr

if source_img is not None:
image: Image = Image.open(source_img)
image: Image = Image.open(source_img).convert('RGB')
start_img_transform: Compose = T.Compose([
T.Resize(image_width),
T.CenterCrop((image_width, image_width)),
Expand Down Expand Up @@ -457,7 +457,7 @@ def create_text_encoding(self, text: str) -> torch.Tensor:
return text_encoding

def create_img_encoding(self, target_img: str) -> torch.Tensor:
target_img: Image = Image.open(target_img)
target_img: Image = Image.open(target_img).convert('RGB')
normed_img: torch.Tensor = self.clip_transform(target_img).unsqueeze(0).to(self.device)

with torch.no_grad():
Expand Down
2 changes: 1 addition & 1 deletion aicon/backend/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
_lock: Lock = Lock()
_twitter_database: Dict[str, str] = {}

_translator: Translation = Translation("deepl")
_translator: Translation = Translation("google")


def _reset_valid_response() -> None:
Expand Down

0 comments on commit 2789457

Please sign in to comment.