Automated curve data extraction. Works with colored curves. Cross-platform. Color decomposition with k-means. X units parser. Automatic axes scale recognition.
-
Download and unzip folder from https://drive.google.com/file/d/1e0UTKwhgJN9DuD2qYsLcWcKd6WomvRkl/view?usp=sharing
-
Download scripts above.
- Create anaconda variable
conda create -n imgrec python=3.9
conda install -n imgrec pip
conda activate imgrec
- Install Tensorflow 2.7
pip install TensorFlow==2.7
- Install protobuf (probably it is already there after previous step; try installation via brew for macOS)
pip install protobuf
- Install some packages
pip install easyocr
pip install opencv-python==4.5.4.60
- Install TF object detection API
Create a directory for Tensorflow Models repository. Go to this directory and do
git clone https://github.com/tensorflow/models.git
cd models/research
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install .
- Check installation
python object_detection/builders/model_builder_tf2_test.py
cd object_detection
mkdir inference_graph
-
copy the content of the inference_graph from folder to the corresponding directory
mkdir training
copy labelmap.pbtxt from folder to training/.
mkdir images
copy file 0.png from folder to images/.
-
copy file label_map_util_v2.py from folder to utils/.
-
copy script object_detection_axes_legend.py from above (step 2) to models/research/object_detection/.
-
run this file from models/research/object_detection/ as
python object_detection_axes_legend.py
You should obtain json and png files for Legend, X axis and Y axis in images/
-
copy scripts posterization.py and color_decomposition.py from above (step 2) to models/research/object_detection/.
-
Run file color_decomposition.py as
python color_decomposition.py
You should obtain png of color cut and palette as well as json and png of separate clusters in images/
-
Copy scripts final-record.py and final_record_func.py from above (step 2) to models/research/object_detection/.
-
Run final-record.py as
python final-record.py
You should obtain json files and png images of final records for all successfully detected clusters.
To work with your figure put figure.PNG to images/.
Regarding the TFOD API part, thanks to https://github.com/TannerGilbert/Tensorflow-Object-Detection-API-Train-Model
If you find this tool or any of it's parts useful, please cite our paper https://www.nature.com/articles/s41597-022-01699-3 You can also find more details regarding the usage of the algorithm there.