mlocr is a simple tool for recognizing chemical structure images and converting them to mol files, based on OSRA.
Clone the repository and navigate to the project folder:
git clone [email protected]:felixnextx/mlocr.git
cd mlocr
Install Flask:
pip install flask
Run the application:
python app.py
You should see output like this:
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5001
Build the Docker image:
docker build -t mlocr:v1.0 .
Run the Docker container:
docker run -p 5000:5000 mlocr:v1.0
You can access the tool via Docker at http://localhost:5000.
You can send a POST request to convert a base64-encoded image of a chemical structure to a mol file using the /base64img2mol endpoint.
Example using curl:
curl --location 'http://127.0.0.1:5000/base64img2mol' \
--header 'Content-Type: application/json' \
--data '{
"img": "base64code"
}'
In the img field, replace "base64code" with your actual base64-encoded image of the chemical structure.