-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop/develop #96
Merged
Merged
Develop/develop #96
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
1d7861b
Merge pull request #80 from nakajima-john-shotaro/hotfix/v1.0.0
nakajima-john-shotaro 3aa23de
[change] footer position adjust
nakajima-john-shotaro 0046a91
[feat] Implemented break-off queue
urasakikeisuke ddb95fa
[change] Changed some constants
urasakikeisuke d9f9e10
[feat] Implemented break-off queue
urasakikeisuke c54f23f
[fix] Disabled to launch Chrome
urasakikeisuke 3eae26f
[change] Changed some functions
urasakikeisuke b85f32d
[update] brush up
nakajima-john-shotaro e1c641c
Merge pull request #82 from nakajima-john-shotaro/feature/frontend/po…
urasakikeisuke c086366
Merge pull request #81 from nakajima-john-shotaro/feature/backend/bre…
nakajima-john-shotaro 7b5c736
[WIP] wip
urasakikeisuke 7f24f56
Merge pull request #83 from nakajima-john-shotaro/feature/backend/twi…
urasakikeisuke d863e6f
[add] Changing communication method.
nakajima-john-shotaro 1bfb615
Merge pull request #84 from nakajima-john-shotaro/feature/frontend/tw…
nakajima-john-shotaro 810504a
[chenge] try new icon
nakajima-john-shotaro a87a3cd
[WIP] wip
urasakikeisuke 9bd6f71
Merge pull request #85 from nakajima-john-shotaro/feature/frontend/tw…
nakajima-john-shotaro c3a4e93
Merge pull request #86 from nakajima-john-shotaro/feature/backend/twi…
urasakikeisuke 9712df2
[change] Add icon and adjust button position
nakajima-john-shotaro 8698b50
[feat] Post on Twitter
urasakikeisuke b0652a7
Merge pull request #87 from nakajima-john-shotaro/feature/backend/twi…
urasakikeisuke 25f992a
Merge pull request #88 from nakajima-john-shotaro/feature/frontend/tw…
nakajima-john-shotaro d1d13f0
[style] Remove unneed code
nakajima-john-shotaro 1989edd
Merge pull request #89 from nakajima-john-shotaro/develop/twitter
nakajima-john-shotaro 1f0c619
[change] Changed tweet text
urasakikeisuke 1e6b638
[update] Modify design.
nakajima-john-shotaro 6f04963
Merge pull request #91 from nakajima-john-shotaro/feature/frontend/tw…
urasakikeisuke dc7a6a2
Merge pull request #90 from nakajima-john-shotaro/develop/backend
nakajima-john-shotaro 187450b
[fix] Fixed a bug
urasakikeisuke 7bc13a4
Merge pull request #92 from nakajima-john-shotaro/develop/backend
nakajima-john-shotaro 38ceef6
[update] Changed display images, added favicons, and fixed display in…
nakajima-john-shotaro 09697bd
Merge pull request #93 from nakajima-john-shotaro/feature/frontend/tw…
urasakikeisuke dcf48cf
Merge pull request #94 from nakajima-john-shotaro/develop/twitter
urasakikeisuke 5335eed
[docs] Changed README
urasakikeisuke b5a2cca
Merge pull request #95 from nakajima-john-shotaro/feature/readme
nakajima-john-shotaro 43a7a4f
[change] remove unneed code
nakajima-john-shotaro 6692674
Merge pull request #97 from nakajima-john-shotaro/develop/backend
urasakikeisuke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,151 @@ | ||
# AIcon_dev | ||
# AIcon 2 | ||
|
||
[![CircleCI](https://circleci.com/gh/nakajima-john-shotaro/AIcon_dev/tree/main.svg?style=svg)](https://circleci.com/gh/nakajima-john-shotaro/AIcon_dev/tree/main) | ||
[![Spell check workflow](https://github.com/nakajima-john-shotaro/AIcon_dev/actions/workflows/misspell-fixer.yml/badge.svg?branch=main)](https://github.com/nakajima-john-shotaro/AIcon_dev/actions/workflows/misspell-fixer.yml) | ||
[![Docker Build CI](https://github.com/nakajima-john-shotaro/AIcon_dev/actions/workflows/docker-ci.yml/badge.svg?branch=main)](https://github.com/nakajima-john-shotaro/AIcon_dev/actions/workflows/docker-ci.yml) | ||
[![CodeQL](https://github.com/nakajima-john-shotaro/AIcon_dev/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/nakajima-john-shotaro/AIcon_dev/actions/workflows/codeql-analysis.yml) | ||
|
||
|
||
## AIconとは | ||
### AIcon is a web application that uses state-of-the-art AI to generate images from input text. | ||
### AIconは最先端のAIを使って、入力された文章からそれに沿った画像を生成するWEBアプリケーションです。 | ||
|
||
# | ||
<div align="center" width="80%" height="auto"> | ||
<img src="assets/logo_black.png" alt="logo" title="logo"> | ||
</div> | ||
|
||
|
||
# Example | ||
* ### *Burning ice* | ||
<div align="center" width="80%" height="auto"> | ||
<img src="assets/burning_ice.png" alt="Burning ice" title="Burning ice"> | ||
</div> | ||
|
||
* ### *New green promenade* | ||
<div align="center" width="80%" height="auto"> | ||
<img src="assets/New_green_promenade.png" alt="New green promenade" title="New green promenade"> | ||
</div> | ||
|
||
* ### *Fire and ice* | ||
<div align="center" width="80%" height="auto"> | ||
<img src="assets/fire_and_ice.png" alt="Fire and ice" title="Fire and ice"> | ||
</div> | ||
|
||
|
||
# Requirements | ||
|
||
- Docker (19.03+) | ||
- Nvidia docker (https://github.com/NVIDIA/nvidia-docker) | ||
|
||
# System Requirements | ||
|
||
## Minimum | ||
- **CPU**: 64-bit Intel or AMD processor (also known as `x86_64`, `x64`, and `AMD64`) | ||
- **Memory**: 8 GB RAM | ||
- **Graphics**: Nvidia GeForce GTX and RTX series from 4 GB RAM or equivalent Nvidia Quadro card | ||
|
||
|
||
## Recommendation | ||
- **CPU**: 64-bit Intel or AMD processor (also known as `x86_64`, `x64`, and `AMD64`) | ||
- **Memory**: 16 GB RAM | ||
- **Graphics**: Nvidia GeForce RTX series from 8 GB RAM with Tensor Core | ||
|
||
|
||
# Platform Support | ||
|
||
- Ubuntu 18.04/20.04 | ||
- WSL2 (Requires `CUDA for WSL Public Preview`. See [here](https://developer.nvidia.com/cuda/wsl)) | ||
|
||
|
||
# Usage | ||
|
||
## 1. Clone this repo. | ||
|
||
## 2. Pull docker image | ||
```sh | ||
docker pull magicspell/aicon:latest | ||
``` | ||
|
||
## (Or build docker image yourself) | ||
```sh | ||
cd docker && ./build-docker.sh | ||
``` | ||
|
||
## 3. Run docker container | ||
```sh | ||
cd docker && ./run-docker.sh | ||
``` | ||
|
||
## 4. Run the AIcon server | ||
```sh | ||
cd backend && python server.py | ||
``` | ||
|
||
## 5. Connect to the sever | ||
With the default settings, you can connect to the server by typing `http://localhost:5050` in the address bar of your browser. | ||
|
||
|
||
# Citations | ||
```bibtex | ||
@misc{unpublished2021clip, | ||
title = {CLIP: Connecting Text and Images}, | ||
author = {Alec Radford, Ilya Sutskever, Jong Wook Kim, Gretchen Krueger, Sandhini Agarwal}, | ||
year = {2021} | ||
} | ||
``` | ||
|
||
```bibtex | ||
@misc{brock2019large, | ||
title = {Large Scale GAN Training for High Fidelity Natural Image Synthesis}, | ||
author = {Andrew Brock and Jeff Donahue and Karen Simonyan}, | ||
year = {2019}, | ||
eprint = {1809.11096}, | ||
archivePrefix = {arXiv}, | ||
primaryClass = {cs.LG} | ||
} | ||
``` | ||
|
||
```bibtex | ||
@misc{sitzmann2020implicit, | ||
title = {Implicit Neural Representations with Periodic Activation Functions}, | ||
author = {Vincent Sitzmann and Julien N. P. Martel and Alexander W. Bergman and David B. Lindell and Gordon Wetzstein}, | ||
year = {2020}, | ||
eprint = {2006.09661}, | ||
archivePrefix = {arXiv}, | ||
primaryClass = {cs.CV} | ||
} | ||
``` | ||
|
||
```bibtex | ||
@misc{ramesh2021zeroshot, | ||
title = {Zero-Shot Text-to-Image Generation}, | ||
author = {Aditya Ramesh and Mikhail Pavlov and Gabriel Goh and Scott Gray and Chelsea Voss and Alec Radford and Mark Chen and Ilya Sutskever}, | ||
year = {2021}, | ||
eprint = {2102.12092}, | ||
archivePrefix = {arXiv}, | ||
primaryClass = {cs.CV} | ||
} | ||
``` | ||
|
||
|
||
```bibtex | ||
@misc{kitaev2020reformer, | ||
title = {Reformer: The Efficient Transformer}, | ||
author = {Nikita Kitaev and Łukasz Kaiser and Anselm Levskaya}, | ||
year = {2020}, | ||
eprint = {2001.04451}, | ||
archivePrefix = {arXiv}, | ||
primaryClass = {cs.LG} | ||
} | ||
``` | ||
|
||
入力した文章を画像に変換するWebアプリケーションです | ||
```bibtex | ||
@misc{esser2021taming, | ||
title = {Taming Transformers for High-Resolution Image Synthesis}, | ||
author = {Patrick Esser and Robin Rombach and Björn Ommer}, | ||
year = {2021}, | ||
eprint = {2012.09841}, | ||
archivePrefix = {arXiv}, | ||
primaryClass = {cs.CV} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,8 +7,8 @@ | |||||
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) | ||||||
import random | ||||||
from multiprocessing import synchronize | ||||||
from multiprocessing import Queue | ||||||
from multiprocessing.synchronize import Event as Event_ | ||||||
from pathlib import Path | ||||||
from queue import Empty | ||||||
|
||||||
|
@@ -265,7 +265,7 @@ def __init__( | |||||
save_mp4_path: str = os.path.join(self.client_data[JSON_MP4_PATH], "timelapse.mp4") | ||||||
self.response_mp4_path: str = save_mp4_path.replace("frontend/", "") | ||||||
|
||||||
self.writer: imageio.core.Format.Writer = get_writer(save_mp4_path, fps=10) | ||||||
self.writer: imageio.core.Format.Writer = get_writer(save_mp4_path, fps=20, quality=10) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
text: str = self.client_data[RECEIVED_DATA][JSON_TEXT] | ||||||
seed: Optional[int] = self.client_data[RECEIVED_DATA][JSON_SEED] | ||||||
|
@@ -278,13 +278,15 @@ def __init__( | |||||
model_name: str = str(self.client_data[RECEIVED_DATA][JSON_BACKBONE]) | ||||||
|
||||||
self.c2i_queue: Queue = self.client_data[CORE_C2I_QUEUE] | ||||||
self.i2c_event: synchronize.Event = self.client_data[CORE_I2C_EVENT] | ||||||
self.c2i_brake_queue: Queue = self.client_data[CORE_C2I_BREAK_QUEUE] | ||||||
self.c2i_event: Event_ = self.client_data[CORE_C2I_EVENT] | ||||||
self.i2c_event: Event_ = self.client_data[CORE_I2C_EVENT] | ||||||
|
||||||
self.put_data: Dict[str, Optional[Union[str, bool]]] = { | ||||||
JSON_HASH: self.client_uuid, | ||||||
JSON_CURRENT_ITER: None, | ||||||
JSON_IMG_PATH: None, | ||||||
JSON_MP4_PATH: None, | ||||||
JSON_MP4_PATH: self.response_mp4_path, | ||||||
JSON_COMPLETE: False, | ||||||
JSON_MODEL_STATUS: False, | ||||||
} | ||||||
|
@@ -541,7 +543,7 @@ def save_image(self, epoch: int, iteration: int, img: Optional[torch.Tensor] = N | |||||
pil_img: Image = T.ToPILImage()(img.squeeze()) | ||||||
pil_img.save(save_filename) | ||||||
|
||||||
self.writer.append_data(np.uint8(np.array(pil_img) * 255.)) | ||||||
self.writer.append_data(np.uint8(np.array(pil_img))) | ||||||
|
||||||
def forward(self): | ||||||
if exists(self.start_image): | ||||||
|
@@ -614,10 +616,10 @@ def forward(self): | |||||
pass | ||||||
|
||||||
self.put_data[JSON_IMG_PATH] = str(self.response_filename) | ||||||
self.put_data[JSON_MP4_PATH] = self.response_mp4_path | ||||||
self.put_data[JSON_COMPLETE] = True | ||||||
|
||||||
self.c2i_queue.put_nowait(self.put_data) | ||||||
self.c2i_brake_queue.put_nowait(self.put_data) | ||||||
self.c2i_event.set() | ||||||
|
||||||
torch.cuda.empty_cache() | ||||||
|
||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.