Skip to content

This Telegram bot identifies whether something is hotdog or not

License

Notifications You must be signed in to change notification settings

ptrvsrg/hotdog-or-not-bot

Repository files navigation

Hotdog or Not Bot

License Github issues Github forks Github stars

About

Have you watched the HBO comedy series "Silicon Valley"? Have you remembered the Hotdog or Not app that Jian Yang developed? This app identifies whether something is hotdog or not.

Features

  • Detecting objects in the photo
  • Hotdog prediction
  • Telegram bot
  • Saving dataset to Yandex Disk

Technologies

Requirements

Before starting, you need to have:

Starting

  1. Clone this project
git clone https://github.com/ptrvsrg/hotdog-or-not-bot.git
cd hotdog-or-not-bot
  1. Create virtual environments
python -m venv .venv
source .venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run http tunnel

NOTE: Run in a separate terminal.

NOTE: ngrok is a globally distributed reverse proxy. We will use it to test the webhook. After launching we have to copy forwarding URL.

ngrok http 8080
  1. Set up environment variables

NOTE: Initialize environment variable WEBHOOK_URL with the value <public URL from ngrok>/webhook

cp .env.exmaple .env
nano .env
export $(cat .env | xargs)
  1. Start database and cache
docker compose --env-file .env up -d
  1. Migrate database
python -m yoyo apply --database postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} ${MIGRATIONS_DIR}
  1. Run application:
python app/main.py

Contribution to the project

If you want to contribute to the project, you can follow these steps:

  1. Create a fork of this repository.
  2. Make the necessary changes.
  3. Create a pull request describing your changes.