チラシ解析のソースの公開
store_adversting_lists
としてリポジトリを作成し公開する
リポジトリは
https://github.com/Snowpooll/store_adversting_lists
descriptionは
1 2 3 | OCR the content of the flyer If your purchase matches Send product name and flyer image with line notify |
チラシの内容をOCRし
購入すとにマッチした場合に
line notify で商品名とチラシ画像を送信する
Public にして
Add a README file
にチェック
License はMITにして
リポジトリを作成
1 | git clone git@github.com:Snowpooll /store_adversting_lists .git |
でリポジトリコピー
あとはファイルをコピーしていく
1 | cp .. /store_adversting_list/gmail_url_extractor .py . |
gmailで件名を指定し未読の最新1件取得しURL抽出
1 | cp .. /store_adversting_list/image_downloader .py . |
画像ファイルダウンロード
1 | cp .. /store_adversting_list/line_notify .py . |
Line notify送信関連
1 | cp .. /store_adversting_list/settings .json . |
キーワードリスト
1 | cp .. /store_adversting_list/utils .py . |
あとでyolov8を使う時に使うモジュール
1 | cp .. /store_adversting_list/config .json . |
Line notify と xpathの設定ファイル
1 | cp .. /store_adversting_list/image_ocr_notifier .py . |
Cloud vision api のOCRと メイン処理
1 | vim .gitignore |
で除外するファイルを設定
1 2 3 4 | token.json config.json credentials.json /images/ |
もしコミットしているのなら
1 | git rm -r --cached images |
で追跡解除可能
次に
requirements.txt
の作成
1 2 3 4 5 6 7 8 | google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client pillow selenium google-cloud-vision requests |
として保存
あとは公開するので
1 2 3 4 | git add . git commit -m "add code" git push -u origin main |
で公開
とりあえずREADMEは後で書く