git clone https://github.com/IngrdInsight/PastePick-py-server.git
cd PastePick-py-serverpython -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windowspip install -r requirements.txt- Update environment variables in .env:
ALLAS_ENDPOINT=
ALLAS_ACCESS_KEY=
ALLAS_SECRET_KEY=
ALLAS_BUCKET=
# Database Configuration
DB_HOST=
DB_PORT=
DB_NAME=
DB_USER=
DB_PASSWORD=
# Server Configuration
HOST=0.0.0.0
PORT=8000
- If needed, initialize the database during the first run. Insructions are available here: link
Option 1: Simple run
python main.pyOption 2: Using uvicorn (recommended for development)
uvicorn main:app --host 0.0.0.0 --port 8000 --reload- Server runs by default on
http://0.0.0.0:8000 --reloadautomatically reloads the server on code changes (for development)
-
POST
/api/process-and-uploadProcess an image: remove background, resize, generate embedding, upload to S3. Returns: Image URL and embedding vector. -
POST
/api/search-by-imageSearch for similar images using an uploaded image. Parameters:limit(number of results),threshold(similarity threshold) Returns: List of matching records. -
GET
/healthHealth check endpoint.
Bug reports help improve PastePick:
- Open an issue on GitHub: New Issue
We welcome contributions!
- Fork the repository
- Create a new branch for your feature or bugfix
- Make your changes
- Submit a pull request