Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krthr/publications-search-ml
https://github.com/krthr/publications-search-ml
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/krthr/publications-search-ml
- Owner: krthr
- Created: 2023-04-04T12:06:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-25T21:31:54.000Z (over 1 year ago)
- Last Synced: 2024-04-16T01:02:54.604Z (7 months ago)
- Language: Python
- Size: 1.34 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ML Server
This is a microservice built on the FastAPI framework that allows you to process images and generate embeddings. It's designed to be fast, efficient, and easy to use.
Using this microservice, you can upload an image to the API, which will then process the image and generate an embedding vector. The embedding vector can be used for various tasks such as face recognition, object detection, or similarity matching.
## How to run the project with Docker
Run the following command to build an image from the Dockerfile:
```bash
docker build -t myapp .
```Here, myapp is the name you want to give to the image, and the . at the end indicates that the build context is the current directory.
Once the image is built, you can run a container from it using the following command:
```bash
docker run -p 8000:8000 -e PORT=8000 myapp
```Here, -p 8000:8000 maps the port 8000 of the container to the port 8000 of the host machine, and -e PORT=8000 sets an environment variable named PORT to the value 8000. Finally, myapp is the name of the image you built in step 3.
This will start a container running the application, which you can access by going to http://localhost:8000 in your web browser.
## Development
If you need to run/test the project you need:
1. Install `python` (we recommend `3.11`)
2. Create a virtual environment within the project folder:```bash
python -m venv venv
```3. Activate the virtual environment and install packages
```bash
# activate
source ./venv/bin/activate# install packages
pip install -r requirements.in
```4. If you need to add a new packages, add it to `requirements.in` and then run `pip-tools` to compile:
```bash
# you need to install pip-tools
pip install pip-tools# compile requirements
pip-compile requirements.in# instsal packages
pip install -r requirements.txt
```5. Run the local server:
```bash
uvicorn app.api:app --host 0.0.0.0 --port 8080 --reload
```