Giter Club home page Giter Club logo

retro-image-generator's Introduction

retro-image-generator

これをPythonで実装してみたい

環境構築

ここを参考にする

  • pyenvはWindows版があるみたい
    • ここを参考にして入れた
    • PowerShellはネットから落としたファイルを実行するのに手間がいるみたいだが、git bashから呼べば手間がいらないみたい
    • 3.11.1をinstallしてglobalにした
  • poetry
    • PowerShellから以下を実行
      • (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
    • To get started you need Poetry's bin directory in your PATH environment variable. の指示に従ってこのパスを環境変数に追加
  • 仮想環境(venv)
    • python -m venv .venv で作成
    • poetry init でプロジェクトを初期化
      • 既にpyproject.tomlがあるなら、poetry installでdependenciesをインストール
    • poetry add opencv-python とかでパッケージをインストール
      • dev.dependenciesなら-Dをつければヨシ
  • 実行
    • poetry run python <python script> でpoetryがvenvの中で実行してくれる

実行方法

  1. image/input配下に画像ファイルを配置。
  2. generator.pyのparametaを入力。
    • img_name: 拡張子を含まないファイル名(jpg)
    • resize_ratio: 800x800以下くらいになるような倍率をいれるといいかも
    • saturation_ratio: 彩度を上げるときの倍率、上げ過ぎると白飛びしたりするかも
  3. 下記コマンドで実行。
poetry run python src/generator.py

retro-image-generator's People

Contributors

seo1nk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.