koji
README.mdにSpace用の情報を追加
707884d
metadata
title: Alien on Mars
emoji: 👽
colorFrom: pink
colorTo: blue
sdk: streamlit
sdk_version: 1.2.0
app_file: app.py
pinned: false

Space App Toyohashi in Japan / 豊橋

Team X Alien (チーム星人)

  • Mr. Takeo (竹尾さん)
  • Mr. Matsubara (松原さん)
  • Me, Shimizu (清水(記))

Choice Theme / 選択したテーマ

Explanation / 説明書き

  • 簡単な火星の環境をシミュレートした遺伝的アルゴリズムにより導き出した究極生命体の特徴(=画像生成に与えるキーワード)を画像生成プログラムに与えて未来に生き残る究極生命体の画像を生成する。

  • The image generation program is given the characteristics of the ultimate life form (= keywords for image generation) derived by a genetic algorithm that simulates a simple Martian environment to generate images of the ultimate life form that will survive in the future.

  • Slide (Sorry, Only Japanese) / スライド(日本語のみ)

  • Movie in YouTube / 紹介動画 YouTube

Output Images by Image Generation / 画像生成により出力した画像

left: first Generation! Very Furry Tall Herd of No teeth Lighter skin Ferocious alien from Mars
center: 500th Generation! Pair Carnivorous Gentle alien from Mars
right: 1000th Generation! Pair Herbivorous Ferocious alien from Mars
エビフライトライアングル      エビフライトライアングル           エビフライトライアングル

How to Execute / 実行方法

  • Verify execution with M1 Mac, Python 3.7.13

  • On Colab

  • On Local

    • Install requirements.txt library in a virtual environment, etc.

Command Example (Mac)

# Create a virtual environment
python -m venv .venv

# Activate your virtual environment.
source .venv/bin/activate

# Upgrade pip
python -m pip install --upgrade pip

# Install library
pip install -r requirements.txt
  • Launch notebook StableDiffusionByCpu.ipynb.

  • Common

    • Create a Hugging Face account.
    • Create an access token in Hugging Face Setting. スクリーンショット 2022-10-05 21 30 00
    • Allow the use of the model you want to use (e.g. CompVis/stable-diffusion-v1-4), referring to the explanation on the official site.
    • Run a Colab or Local notebook, enter the Hugging Face token into the notebook, login and run the notebook. スクリーンショット 2022-10-05 21 33 06

  • M1 Mac, Python 3.7.13 で実行を確認

  • グーグルコラボ

  • ローカル環境

    • 仮想環境などに requirements.txt のライブラリをインストールする

コマンド例(Mac)

# 仮想環境の作成
python -m venv .venv

# 仮想環境のアクティベート
source .venv/bin/activate

# pip のアップグレード
python -m pip install --upgrade pip

# ライブラリのインストール
pip install -r requirements.txt
  • stable_diffusion_cpu.ipynb を立ち上げる

  • 共通

    • Hugging Faceのアカウントを作成する
    • Hugging Face の Settingでアクセストークンを作成する スクリーンショット 2022-10-05 21 30 00
    • 公式サイトの解説を参考に、使用するモデル(例: CompVis/stable-diffusion-v1-4)の使用を許可する
    • Colab または Local のノートブックを実行し、Hugging Face のトークンをノートブックに入力しログインしてノートブックを実行する。 スクリーンショット 2022-10-05 21 33 06

File Organization / ファイル構成

  • stable_diffusion_cpu.ipynb
    • An executable file that performs image generation locally.
    • ローカルで画像生成を行う実行ファイル。
  • simulation.py
    • File with genetic algorithm simulations, required for both Colab and local.
    • 遺伝的アルゴリズムによるシミュレーションを行っているファイル。Colab、ローカルいずれの場合も必要。
  • sample_output_images
    • Folder containing the Output image described above.
    • 上述の Output 画像が入ったフォルダ

Reference site / 参考サイト