Code Monkey home page Code Monkey logo

pokemon63's Introduction

img

みんなの63

これは「みんなの63 - 振り返って強くなる自動解析できるポケモン選出投稿サイト」の開発レポジトリです。

Installation

Environment Varialbles

Firebase のプロジェクトを用意して設定してください。

手軽に確認したい場合、テスト用に用意している Firebase プロジェクトがあるため、cp .env.sample .env にて、以下を設定ください。

FIREBASE_API_KEY="AIzaSyB-Jh74U8rwbQq6sMyLTliOamXhGyE3U2g"
FIREBASE_AUTH_DOMAIN="minnano63-dev.firebaseapp.com"
FIREBASE_DATABASEURL="https://minnano63-dev.firebaseio.com"
FIREBASE_PROJECT_ID="minnano63-dev"
FIREBASE_STORAGE_BUCKET="minnano63-dev.appspot.com"
FIREBASE_MESSAGING_SENDER_ID="924539713345"
FIREBASE_APP_ID="1:924539713345:web:a5ab68eff31fcab88b53c0"
FIREBASE_MEASUREMENT_ID="G-SJ4HEZYE1T"

Hosting へのデプロイやセキュリティルールの設定などはできませんが、全てが読み書きできる状態で開放されています。

Image assets(optional)

ソースコード上には、みんなの63に関わる最低限のアセットのみが存在します。

ローカルで利用したい場合、/pokemon63/static/images/icons/1.png から /pokemon63/static/images/icons/527.png までの画像を、なんらかの手段で src/static/static/images/icons へと配置してください。

配置が完了した後、以下のコマンドを実行することで、ローカルでもポケモンのアイコンなどを利用しての動作確認が可能となります。

$ cd src/static
$ mkdirp pokemon63
$ cd pokemon63
$ ln -s ../static/ ./static/

Server

$ yarn
$ yarn dev
$ open 'http://localhost:3000/pokemon63/'

LICENCE

MIT

pokemon63's People

Contributors

dependabot[bot] avatar potato4d avatar ushironoko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pokemon63's Issues

chore: Logging use fix popup

About

アナライザーの修正のために、どのポケモンがどのポケモンと誤検知されたかのデータを集計しておきたい。
修正が実行されとき、 Firebase Analytics にイベントを送信する。

feat: Allow opponents to omit selected Pokemon

対戦相手の選出はすべて見えない可能性があるため、一体以上選出選択されていれば投稿できるようにしたい。

image
上記状態で取り込むが押せるようにする

feat: Make it possible to omit the extension of the URL required to import images from twitter

現状twingのうrlに拡張子がついていないと不正なデータ扱いになるが、Web版Twitterから投稿画像右クリック→新規タブで開くをすると下記のようなうrlになる。

https://pbs.twimg.com/media/EW-6DbgVcAA2AIm?format=jpg&name=large

クエリパラメータ付きを許容するか、拡張子を削った状態でも投稿できるようにしたい。

image

bug: inputted text is cleared when uploaded an image

画像のアップロードを行う前に下書きしておいたテキストが消えてしまう。初期リリース版では残るようになっていたので試合中にメモしながら試合後に画像をアップロードすることができたが、できなくなってしまった

feat: Use diff for analyze screen shot

About

現状は Jimp の distanceFromHash を使って、画像のハッシュ同士の距離から類似度を推定しているが、これだけだと精度の面でいくつか課題があるため、指標を追加して対処したい。

現状のアプローチ

  1. 事前に png 画像として正しく完全にトリミングが終わった画像のハッシュを用意
  2. jpeg ノイズを考慮し、ある程度甘めに背景色の同一判定を行った上で、スクリーンショットを最低限のサイズでトリミング
  3. トリミングしたスクリーンショットの画像ハッシュを取得し、すべてのポケモン画像と比較
  4. 最も近似しているものを対象のポケモンとして設定

課題点

  • サニーゴとガラルサニーゴのような、完全に同じ見た目の種族違いを検出できない
    • マホイップなど、同じ種族で色が違う場合は誤検出しても本質的には問題がない

新たに行いたいアプローチ

  1. 事前に png 画像として正しく完全にトリミングが終わった画像のハッシュを用意
  2. jpeg ノイズを考慮し、ある程度甘めに背景色の同一判定を行った上で、スクリーンショットを最低限のサイズでトリミング
  3. トリミングしたスクリーンショットの画像ハッシュを取得し、すべてのポケモン画像と比較
  4. 最も近似しているものを対象のポケモンとして設定
  5. 近似しているものが複数ある場合、 Jimp の diff も合わせて行い、 percent によって最も近いポケモンを判定する。

課題点

  • 画像を bitmap 化したすべての情報が必要となるため、ファイルサイズ・実行時間ともに肥大化する
  • やるのであれば1,2,3位の類似度がどれも極端に高い場合などに限定したい

feat: Edit battle record

About

選出ログを編集できるようにしたい。

匿名ユーザーの場合はダメ

chore: Improve worker performance

About

ポケモン一匹ごとに Worker の JavaScript を読みに行っているのでネットワークレイテンシが激しい。

パフォーマンス改善のため、 Worker インスタンスを使い回すことにする。

Re-uploading the image keeps the previous election

画像アップロード→選出→別の対戦画像を再度アップロードの手順で再現。

再アップロード時の選出が空でも前の選出を保持しているため、取り込むボタンが押せてしまう。

image

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.