Easier, faster, and more efficient way to extract text from Chat Screenshot.
Create a virtual environment with Python 3.10. Two requirements
files are provided. One (requirements.light.txt
) with a small number of packages for API only usages, another (requirements.txt
) is with more packages and a GUI support using Gradio. Install either one as per your necessity.
pip install -r requirements.txt
To initiate the GUI run python ui.py
from your terminal. You'll see the private and public URL in the terminal output. Hit the URL and it will open the user interface.
Important
Full dependencies should be installed using requirement.txt
![image](https://private-user-images.githubusercontent.com/80112748/300385236-e32cc9bf-5006-4a12-bae6-165001d4e4dd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNzI2ODksIm5iZiI6MTcyMTM3MjM4OSwicGF0aCI6Ii84MDExMjc0OC8zMDAzODUyMzYtZTMyY2M5YmYtNTAwNi00YTEyLWJhZTYtMTY1MDAxZDRlNGRkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDA2NTk0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY4MTBmMGU5MDlkMzVlYzM3Y2E2Mzg4Zjg4MWZjNGUwZWNhNjg5NGM2NTg4MTkxOWQzMzdhZWVmNDM1ZGMyMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.fuPU9NlO4_wf2viiJkwTLifSk0SU8oT2po2ZOZvbqNI)
To run the app in API only mode simply execute ./run.sh
from your terminal.
GET /api/v1/extract
Param | Type | Default | Description |
---|---|---|---|
url (required) | str | None | URL of an image file |
list (optional) | bool | False | Determines the output format |
You should use a process control system like supervisor
to run the app in production mode. We recommend to use gunicorn
– which is included in requirements – to run the app. Here's an example of the supervisor configuration.
[program:chatparser]
directory=path/to/chatparser
command=path/to/venv/gunicorn -c gunicorn.conf.py wsgi:app
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
user=<user-of-your-system>
numprocs=1
startsecs=1
redirect_stderr=true
stdout_logfile=/path/to/log/file.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=3
stopwaitsecs=60
stopsignal=SIGTERM
stopasgroup=true
killasgroup=true
Note
By default in gunicorn.conf.py
file we set the port
to 5023 and workers
to 4. Adjust these values as per your system resources.