{"id":13934930,"url":"https://github.com/bloomberg/scatteract","last_synced_at":"2025-08-21T03:32:46.578Z","repository":{"id":66125227,"uuid":"97024917","full_name":"bloomberg/scatteract","owner":"bloomberg","description":"Project which implements extraction of data from scatter plots","archived":false,"fork":false,"pushed_at":"2019-06-21T18:53:07.000Z","size":86574,"stargazers_count":214,"open_issues_count":5,"forks_count":37,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-08T03:34:56.149Z","etag":null,"topics":["python","tensorflow","tensors"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bloomberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license/SCATTERACT_LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-12T15:40:25.000Z","updated_at":"2025-04-04T09:27:16.000Z","dependencies_parsed_at":"2023-10-20T18:18:59.506Z","dependency_job_id":null,"html_url":"https://github.com/bloomberg/scatteract","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bloomberg/scatteract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fscatteract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fscatteract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fscatteract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fscatteract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloomberg","download_url":"https://codeload.github.com/bloomberg/scatteract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fscatteract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271420525,"owners_count":24756584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","tensorflow","tensors"],"created_at":"2024-08-07T23:01:19.011Z","updated_at":"2025-08-21T03:32:41.568Z","avatar_url":"https://github.com/bloomberg.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"# Scatteract\n\n![Scatteract](/scatteract_image.png)\n\nScatteract is a framework to automatically extract data from the image of scatter plots.  We use \u003ca href=\"https://github.com/TensorBox/TensorBox\" target=\"_blank\"\u003eTensorBox\u003c/a\u003e\u003csup\u003e1\u003c/sup\u003e to detect the relevant objects (points, tick marks and tick values), \u003ca href=\"https://github.com/tesseract-ocr/tesseract\" target=\"_blank\"\u003eTesseract\u003c/a\u003e for the OCR, and several heuristics to extract the points in chart coordinates.   See \u003ca href=\"https://arxiv.org/abs/1704.06687\" target=\"_blank\"\u003ethe paper\u003c/a\u003e for details.\nThis repository is meant to support \u003ca href=\"https://arxiv.org/abs/1704.06687\" target=\"_blank\"\u003ethe paper\u003c/a\u003e and is not an attempt at creating an actual open source project.\n\n\u003csup\u003e1\u003c/sup\u003e\u003cb\u003eDisclaimer\u003c/b\u003e: We vendored the TensorBox dependency into the `tensorbox` folder since there is no way to pull it in from pypi. We have made no change to this code.\n\n### Requirements:\ntensorflow==0.10.0rc0 \u003cbr /\u003e\nscipy (tested on 0.17.1) \u003cbr /\u003e\nscikit-learn (tested on 0.17.1) \u003cbr /\u003e\npandas (tested on 0.18.1) \u003cbr /\u003e\nPillow (PIL) (tested on 3.2.0) \u003cbr /\u003e\nnumpy (tested on 1.10.4) \u003cbr /\u003e\nopencv-python (cv2)  (tested on 2.4.10) \u003cbr /\u003e\nmatplotlib  (tested on 1.5.1) \u003cbr /\u003e\nruncython (tested on 0.25) \u003cbr /\u003e\npyocr  (tested on 0.4.6) \u003cbr /\u003e\ntesseract-ocr (tested on 3.02)\n\nOn Python 2.7+, the following compatibility module is also required:\n\nbackports.functools_lru_cache\n\n## How to use:\n\n### Generate training and testing data\n\n    $ python generate_random_scatter.py --directory plots_v1 --n_train 25000 --n_test 500 \n\n\n### Train object detection models\nNote that we are using an older version of TensorBox which crashes once training is done because of threading issues, nevertheless the trained models are successfully saved.\n\n    \u0026 cd tensorbox/utils/ \u0026\u0026 make \u0026\u0026 cd ../..\n    $ python tensorbox/train_obj_model.py --hypes hypes/lstm_rezoom_plot_points.json --gpu 0 --logdir output  --name points_v1\n    $ python tensorbox/train_obj_model.py --hypes hypes/lstm_rezoom_plot_ticks.json --gpu 0 --logdir output  --name ticks_v1\n    $ python tensorbox/train_obj_model.py --hypes hypes/lstm_rezoom_plot_labels.json --gpu 0 --logdir output  --name labels_v1\n \n\n### IPython Notebook\nThe [ipython notebook](https://github.com/bloomberg/scatteract/blob/master/Scatteract_notebook.ipynb) can be used after the object detection models are trained.  It allows you to interact with the building blocks of Scatteract and visualize their outputs.  \n\n### Test object detection models\n\n    On the randomly generated test set:\n    $ chmod +x tensorbox -R\n    $ python test_obj_model.py --model_dir output/points_v1 --iteration 125000 --image_dir data/plots_v1 --true_idl data/plots_v1/test_points.idl \n    $ python test_obj_model.py --model_dir output/ticks_v1 --iteration 125000 --image_dir data/plots_v1 --true_idl data/plots_v1/test_ticks.idl \n    $ python test_obj_model.py --model_dir output/labels_v1 --iteration 125000 --image_dir data/plots_v1 --true_idl data/plots_v1/test_labels.idl \n\n    On a currated randomly generated test set:\n    $ chmod +x tensorbox -R\n    $ python test_obj_model.py --model_dir output/points_v1 --iteration 125000 --image_dir data/plot_test --true_idl data/plot_test/points.idl\n    $ python test_obj_model.py --model_dir output/ticks_v1 --iteration 125000 --image_dir data/plot_test --true_idl data/plot_test/ticks.idl\n    $ python test_obj_model.py --model_dir output/labels_v1 --iteration 125000 --image_dir data/plot_test --true_idl data/plot_test/labels.idl \n\n\n### Test OCR\n\n    On the randomly generated test set:\n    $ python generate_test_tesseract.py --image_dir data/plots_v1 --label_values_idl  data/plots_v1/test_label_values.idl \n    $ python tesseract.py --tsv_truth data/plots_v1/label_image_values.tsv --image_dir data/plots_v1/label_images\n\n    On a currated randomly generated test set:\n    $ python tesseract.py --tsv_truth data/plot_test/label_image_values.tsv --image_dir data/plot_test/label_images\n\n\n### Test end-to-end system\n\n    On a currated randomly generated test set:\n    \u0026 python scatter_extract.py --model_dict '{\"ticks\":\"./output/ticks_v1\", \"labels\":\"./output/labels_v1\",\"points\":\"./output/points_v1\"}' \\\n    --true_idl_dict '{\"ticks\":\"./data/plot_test/ticks.idl\",\"labels\":\"./data/plot_test/labels.idl\", \"points\":\"./data/plot_test/points.idl\"}' \\\n    --image_output_dir image_output --csv_output_dir csv_output --true_coord_idl ./data/plot_test/coords.idl \\\n    --iteration 125000 --image_dir data/plot_test/ \n\n\n### Predict with end-to-end system (i.e. extract data points from plots with no ground truth)\n\n    On a set of plots scrapped from the web:\n    $ python scatter_extract.py --model_dict '{\"ticks\":\"./output/ticks_v1\", \"labels\":\"./output/labels_v1\",\"points\":\"./output/points_v1\"}' \\\n    --iteration 125000 --image_dir data/plot_real/ --predict_idl ./data/plot_real/test_real.idl --image_output_dir image_output --csv_output_dir csv_output\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fscatteract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloomberg%2Fscatteract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fscatteract/lists"}