Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alivx/ocr-fastapi-demo
Demo app for sync and asyncio using fastAPI
https://github.com/alivx/ocr-fastapi-demo
async fastapi fastapi-crud redis rq synchronization
Last synced: 1 day ago
JSON representation
Demo app for sync and asyncio using fastAPI
- Host: GitHub
- URL: https://github.com/alivx/ocr-fastapi-demo
- Owner: alivx
- License: apache-2.0
- Created: 2022-11-28T02:07:10.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-10T14:08:18.000Z (8 months ago)
- Last Synced: 2024-12-25T20:03:22.560Z (8 days ago)
- Topics: async, fastapi, fastapi-crud, redis, rq, synchronization
- Language: Python
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OCR Service
testing OCR API using FastAPI to demonstrate asyncio, async, and queueing
### Dependencies
1. Docker
2. Docker-compose### AsyncIO
Using:
1. aiofile
2. aiopytesseract
3. miniopy_asynchttps://github.com/alivx/ocr-fastapi-demo/blob/master
### Sync
1. pytesseract
### AsyncIO with queue
Using:
1. aiofile
2. aiopytesseract
3. miniopy_async
4. RQ### Start the service
```
docker-compose build
docker-compose up
```### API request
Sync
```
curl --location --request POST 'http://127.0.0.1:8000/upload' \
--form 'image=@"/${path}.png"'
```
AsyncIO
```
curl --location --request POST 'http://127.0.0.1:8001s/upload' \
--form 'image=@"/${path}.png"'
```
AsyncIO with queue
```
curl --location --request POST 'http://127.0.0.1:8002/upload' \
--form 'image=@"/${path}.png"'
```### Stress test
```
locust -f stress.py
```