{"id":21930732,"url":"https://github.com/previsionio/prevision-object-detector-app","last_synced_at":"2026-05-07T07:37:00.949Z","repository":{"id":86604784,"uuid":"429722639","full_name":"previsionio/prevision-object-detector-app","owner":"previsionio","description":"Web app boilerplate ( Flask + javascript ) for using Prevision Object detector API","archived":false,"fork":false,"pushed_at":"2021-11-19T15:02:30.000Z","size":343,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-27T12:21:17.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/previsionio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-19T08:28:07.000Z","updated_at":"2021-11-19T15:10:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e81def1-c1d0-4010-a803-d7ee573017f9","html_url":"https://github.com/previsionio/prevision-object-detector-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/previsionio%2Fprevision-object-detector-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/previsionio%2Fprevision-object-detector-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/previsionio%2Fprevision-object-detector-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/previsionio%2Fprevision-object-detector-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/previsionio","download_url":"https://codeload.github.com/previsionio/prevision-object-detector-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959444,"owners_count":20538626,"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":[],"created_at":"2024-11-28T23:11:14.980Z","updated_at":"2026-05-07T07:37:00.866Z","avatar_url":"https://github.com/previsionio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploying an image detector app\n\n## Pre-requiste\n\n- An object detector model : This app only works with Object Detector models\n- client id\n- client secret\n- model url\n- optionnal : an app url, to generate doc\n  \n## Setup for Dev \n\n- fork this project and then clone\n- fill the .env file ( see .env.example )\n- Create a python virtual env and install ( we advise you t use python 3.8)\n\n\n``` \ngit clone git@github.com:previsionio/prevision-object-detector-app.git\ncd prevision-object-detector-app.git\npython3.8 -m venv env\npip install -r requirements.txt \n\n```\n\nThen create a `.env` file from the `env.example` and fill it with the information from your model\n\n```\nclient_id=\u003cYOUR CLIENT ID\u003e\u003e\nclient_secret=\u003cYOUR CLIENT_SECRET\u003e\nmodel_url=\u003cYOUR_MODEL_URL\u003e\nappurl=\u003cYOU_APP_URL\u003e\n```\n\n![tokens](doc-img/model_token.png)\n![model url](doc-img/model-url.png)\n\n( _You can fill the appurl env var to generate doc_ )\n\nThen launch server using gunicorn\n\n```\ngunicorn --reload --bind 0.0.0.0:8080 --timeout 120  --limit-request-line 0   --access-logfile - run:app\n```\n\nGo to http://localhost:8080/ and check everything is fine. You should see a webapp.  You can test the API with the curl command (  using any image you want ):\n\n```\ncurl --location --request POST 'http://localhost:8080/api/model/prediction' \\\n--form 'img=@\"./test_img.jpg\"'\n```\n\nIf both the webapp and curl command are ok, you can proceed to customisation or deployment\n\n## Customisation\n\nServer is flask based with jinja as template engine. You can edit the `app/templates/base.html` to tweak your footer and header.\n\nYou can change the content of the `app/templates/about` page or add page to you project in the `run.py` file.\n\nYou can change colors and font in the `app/styles.css` file.\n\nAbout your model, you can edit advice from object detected and threshold in the `routers/blueprint_model/adviceabout` function.\n\n## Prod\n\nIf everything is fine  you can deploy to your account. Juste deploy a new app, do not forget to fill the env var with the content of your .env file.\n\n![deploy](doc-img/model_token.png)\n\n![deploy](doc-img/deploy_app.png)\n\n![deploy](doc-img/deploy_env_var.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprevisionio%2Fprevision-object-detector-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprevisionio%2Fprevision-object-detector-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprevisionio%2Fprevision-object-detector-app/lists"}