{"id":18448728,"url":"https://github.com/mindee/doctr-tfjs-demo","last_synced_at":"2025-04-08T01:32:38.400Z","repository":{"id":38963097,"uuid":"411274508","full_name":"mindee/doctr-tfjs-demo","owner":"mindee","description":"Javascript demo of docTR, powered by TensorFlowJS","archived":false,"fork":false,"pushed_at":"2024-04-05T14:20:26.000Z","size":170953,"stargazers_count":78,"open_issues_count":23,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-30T17:58:20.101Z","etag":null,"topics":["computer-vision","deep-learning","node-js","ocr","optical-character-recognition","reactjs","tensorflowjs","yarn"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mindee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-28T12:34:55.000Z","updated_at":"2024-04-29T01:51:26.000Z","dependencies_parsed_at":"2023-02-15T07:45:46.631Z","dependency_job_id":null,"html_url":"https://github.com/mindee/doctr-tfjs-demo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fdoctr-tfjs-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fdoctr-tfjs-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fdoctr-tfjs-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fdoctr-tfjs-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mindee","download_url":"https://codeload.github.com/mindee/doctr-tfjs-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223296967,"owners_count":17121977,"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","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":["computer-vision","deep-learning","node-js","ocr","optical-character-recognition","reactjs","tensorflowjs","yarn"],"created_at":"2024-11-06T07:16:54.941Z","updated_at":"2024-11-06T07:16:55.600Z","avatar_url":"https://github.com/mindee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docTR Tensorflow.js demo\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) ![Build Status](https://github.com/mindee/doctr-tfjs-demo/workflows/builds/badge.svg)\n\n\u003cimg width=\"15%\" align=\"left\" src=\"https://github.com/teamMindee/tensorflow-js-demo/releases/download/v0.1-models/icon_doctr.gif\"\u003e\n\n\u003cbr/\u003e\n\nThis project is based on [docTR](https://github.com/mindee/doctr) and leverages [TensorFlow.js](https://www.tensorflow.org/js) to serve you an end-to-end OCR running directly in your favorite web browser.\n\n\u003cbr/\u003e\u003cbr/\u003e\n\n![demo](https://github.com/teamMindee/tensorflow-js-demo/releases/download/v0.1-models/demo_illustration.png)\n\n\nFor this project, models were trained with docTR using its TensorFlow back-end, then converted to the TJFS SavedModel format thanks to the [`tensorflowjs_converter`](https://www.tensorflow.org/js/tutorials/conversion/import_saved_model). Just like docTR, under the hood, there are two types of modules:\n- **Text detection**: `db_mobilenet_v2` (low resolution) \u0026 [`db_resnet50`](https://mindee.github.io/doctr/latest/models.html#doctr.models.detection.db_resnet50) (high resolution) as available architectures, post-processing performed with [OpenCV.js](https://docs.opencv.org/3.4/d5/d10/tutorial_js_root.html).\n- **Text recognition**: [`crnn_vgg16_bn`](https://mindee.github.io/doctr/latest/models.html#doctr.models.recognition.crnn_vgg16_bn) as available architecture\n\nDocumentation about all the models can be found over [here](https://mindee.github.io/doctr/models.html).\n\n\n## Using the interface\n\nThe interface is divided into five sections:\n- **Model settings** (side pannel): select the architectures to use for text detection and for text recognition.\n- **Input Image** (top-left pannel): upload your image there by clicking in the area \u0026 selecting your file. Uploading a file will automatically run the OCR on it.\n- **Text localization** (top-right pannel): the output of the text localization module.\n- **Detected word boxes** (bottom-left pannel): visualization of the final predictions of the OCR.\n- **Words** (bottom-right pannel): the list of all the detected words. If you hover a prediction on the bottom-left pannel, it will highlight the corresponding text prediction in this section.\n\n\n## Getting started\n\n### Prerequisites\n\nIn order to install this project, you will need [Yarn](https://classic.yarnpkg.com/lang/en/docs/install) and [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), which are package managers for [Node.js](https://nodejs.org/en/).\n\n```shell\nnpm install -g serve\n```\n\n### Installation\n\nThis demo was built using [React](https://reactjs.org/), a framework for JavaScript development. This demo requires you to install the project from the source code, which will require you to install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). First clone the project repository:\n```shell\ngit clone https://github.com/mindee/doctr-tfjs-demo.git\n```\n\nThen install the project's dependencies using the following command:\n\n```shell\ncd doctr-tfjs-demo\nyarn install\n```\n\n### Running the app\n\n#### Production mode\n\nAlternatively, if you are looking at a production situation, first build the bundle and serve it:\n```shell\nyarn build\nserve --no-clipboard -s build\n```\nthen navigate to the URL with your favorite web browser\n\n#### Development mode\n\nOnce all dependencies have been installed, launch the app using:\n```shell\nyarn start\n```\nand navigate with your web browser to the URL in the console.\n\n### Using Docker container\n\nLucky for you, if you prefer working with containers, we provide a minimal Docker image. You can build it as follows (it might take a few minutes depending on your setup):\n```shell\nDOCKER_BUILDKIT=1 docker build . -t doctr-tfjs:node12-alpine\n```\nand then run your image with:\n```shell\ndocker run -p 8001:3000 doctr-tfjs:node12-alpine\n```\nFeel free to change the port, but by default, you should be able to access the demo at `http://localhost:8001/`. *The `-p 8001:3000` lets Docker know that we want to map the internal port of the container (3000) to port 8001 on the outside.*\n\n\n## License\n\nDistributed under the Apache 2.0 License. See [`LICENSE`](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindee%2Fdoctr-tfjs-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindee%2Fdoctr-tfjs-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindee%2Fdoctr-tfjs-demo/lists"}