{"id":20041734,"url":"https://github.com/ajithvcoder/people_counter_app_udacity","last_synced_at":"2026-06-05T01:32:02.745Z","repository":{"id":111987314,"uuid":"276192404","full_name":"ajithvcoder/people_counter_app_udacity","owner":"ajithvcoder","description":"contains helper files for people counter app udacity","archived":false,"fork":false,"pushed_at":"2020-07-28T08:15:30.000Z","size":66359,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T19:30:43.459Z","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/ajithvcoder.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}},"created_at":"2020-06-30T19:38:56.000Z","updated_at":"2020-07-28T08:10:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed11144f-1c93-462f-bd17-bb2fce10f450","html_url":"https://github.com/ajithvcoder/people_counter_app_udacity","commit_stats":null,"previous_names":["ajithvcoder/people_counter_app_udacity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2Fpeople_counter_app_udacity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2Fpeople_counter_app_udacity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2Fpeople_counter_app_udacity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajithvcoder%2Fpeople_counter_app_udacity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajithvcoder","download_url":"https://codeload.github.com/ajithvcoder/people_counter_app_udacity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241470401,"owners_count":19968041,"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-13T10:47:39.190Z","updated_at":"2026-06-05T01:32:02.733Z","avatar_url":"https://github.com/ajithvcoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Please read Step 0 for setting up the project\n\n# Deploy a People Counter App at the Edge\n\n| Details            |              |\n|-----------------------|---------------|\n| Programming Language: |  Python 3.5 or 3.6 |\n\n![people-counter-python](./images/people-counter-image.png)\n\n## What it Does\n\nThe people counter application will demonstrate how to create a smart video IoT solution using Intel® hardware and software tools. The app will detect people in a designated area, providing the number of people in the frame, average duration of people in frame, and total count.\n\n## How it Works\n\nThe counter will use the Inference Engine included in the Intel® Distribution of OpenVINO™ Toolkit. The model used should be able to identify people in a video frame. The app should count the number of people in the current frame, the duration that a person is in the frame (time elapsed between entering and exiting a frame) and the total count of people. It then sends the data to a local web server using the Paho MQTT Python package.\n\nYou will choose a model to use and convert it with the Model Optimizer.\n\n![architectural diagram](./images/arch_diagram.png)\n\n## Requirements\n\n### Hardware\n\n* 6th to 10th generation Intel® Core™ processor with Iris® Pro graphics or Intel® HD Graphics.\n* OR use of Intel® Neural Compute Stick 2 (NCS2)\n* OR Udacity classroom workspace for the related course\n\n### Software\n\n*   Intel® Distribution of OpenVINO™ toolkit 2019 R3 release\n*   Node v6.17.1\n*   Npm v3.10.10\n*   CMake\n*   MQTT Mosca server\n  \n        \n## Setup\n\n### Install Intel® Distribution of OpenVINO™ toolkit\n\nUtilize the classroom workspace, or refer to the relevant instructions for your operating system for this step.\n\n- [Linux/Ubuntu](./linux-setup.md)\n- [Mac](./mac-setup.md)\n- [Windows](./windows-setup.md)\n\n### Install Nodejs and its dependencies\n\nUtilize the classroom workspace, or refer to the relevant instructions for your operating system for this step.\n\n- [Linux/Ubuntu](./linux-setup.md)\n- [Mac](./mac-setup.md)\n- [Windows](./windows-setup.md)\n\n### Install npm\n\nThere are three components that need to be running in separate terminals for this application to work:\n\n-   MQTT Mosca server \n-   Node.js* Web server\n-   FFmpeg server\n     \nFrom the main directory:\n\n* For MQTT/Mosca server:\n   ```\n   cd webservice/server\n   npm install\n   ```\n\n* For Web server:\n  ```\n  cd ../ui\n  npm install\n  ```\n  **Note:** If any configuration errors occur in mosca server or Web server while using **npm install**, use the below commands:\n   ```\n   sudo npm install npm -g \n   rm -rf node_modules\n   npm cache clean\n   npm config set registry \"http://registry.npmjs.org\"\n   npm install\n   ```\n\n## Model used :\nssd mobile net \n\n## Running the application\n\nFrom the main directory:\n\n\n### Step 0 : setting up SSD mobile net model \n\nif you are stuck some where u can mail me at inocajith21.5@gmail.com\n\nEither you can do all the steps in step 0 or else you can clone this repo https://github.com/ajithvallabai/people_counter_app_udacity\nand put the ssd_mo_model in main directory \n\n\nFrom the main directory \n\nDownload pretrained mode \nhttp://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_coco_2018_03_29.tar.gz\n\nExtract files \n\n```\ntar -xvf ssd_mobilenet_v2_coco_2018_03_29.tar.gz\n```\n\ninside ssd_movilenet directory run below command\n```\npython /opt/intel/openvino/deployment_tools/model_optimizer/mo_tf.py --input_model frozen_inference_graph.pb --tensorflow_object_detection_api_pipeline_config pipeline.config --tensorflow_use_custom_operations_config /opt/intel/openvino/deployment_tools/model_optimizer/extensions/front/tf/ssd_v2_support.json --reverse_input_channel\n```\ncreate a directory \"ssd_mo_model\"\n```\nmkdir ssd_mo_model\n```\nput xml,bin,mapping in side \"ssd_mo_model\"\n\n\n### Step 1 - Start the Mosca server\n\n```\ncd webservice/server/node-server\nnode ./server.js\n```\n\nYou should see the following message, if successful:\n```\nMosca server started.\n```\n\n### Step 2 - Start the GUI\n\nOpen new terminal and run below commands.\n```\ncd webservice/ui\nnpm run dev\n```\n\nYou should see the following message in the terminal.\n```\nwebpack: Compiled successfully\n```\n\n### Step 3 - FFmpeg Server\n\nOpen new terminal and run the below commands.\n```\nsudo ffserver -f ./ffmpeg/server.conf\n```\n\n### Step 4 - Run the code\n\nYou must configure the environment to use the Intel® Distribution of OpenVINO™ toolkit one time per session by running the following command:\n```\nsource /opt/intel/openvino/bin/setupvars.sh -pyver 3.5\n```\n\n\nOpen a new terminal to run the code. \n```\npython main.py -i resources/Pedestrian_Detect_2_1_1.mp4 -m ssd_mo_model/frozen_inference_graph.xml -l /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libcpu_extension_sse4.so -d CPU -pt 0.6 | ffmpeg -v warning -f rawvideo -pixel_format bgr24 -video_size 768x432 -framerate 24 -i - http://0.0.0.0:3004/fac.ffm\n```\n\n#### Setup the environment\n\n\nYou should also be able to run the application with Python 3.6, although newer versions of Python will not work with the app.\n\n#### Running on the CPU\n\nWhen running Intel® Distribution of OpenVINO™ toolkit Python applications on the CPU, the CPU extension library is required. This can be found at: \n\n```\n/opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/\n```\n\n*Depending on whether you are using Linux or Mac, the filename will be either `libcpu_extension_sse4.so` or `libcpu_extension.dylib`, respectively.* (The Linux filename may be different if you are using a AVX architecture)\n\nThough by default application runs on CPU, this can also be explicitly specified by ```-d CPU``` command-line argument:\n\n```\npython main.py -i resources/Pedestrian_Detect_2_1_1.mp4 -m your-model.xml -l /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libcpu_extension_sse4.so -d CPU -pt 0.6 | ffmpeg -v warning -f rawvideo -pixel_format bgr24 -video_size 768x432 -framerate 24 -i - http://0.0.0.0:3004/fac.ffm\n```\nIf you are in the classroom workspace, use the “Open App” button to view the output. If working locally, to see the output on a web based interface, open the link [http://0.0.0.0:3004](http://0.0.0.0:3004/) in a browser.\n\n#### Running on the Intel® Neural Compute Stick\n\nTo run on the Intel® Neural Compute Stick, use the ```-d MYRIAD``` command-line argument:\n\n```\npython3.5 main.py -d MYRIAD -i resources/Pedestrian_Detect_2_1_1.mp4 -m your-model.xml -pt 0.6 | ffmpeg -v warning -f rawvideo -pixel_format bgr24 -video_size 768x432 -framerate 24 -i - http://0.0.0.0:3004/fac.ffm\n```\n\nTo see the output on a web based interface, open the link [http://0.0.0.0:3004](http://0.0.0.0:3004/) in a browser.\n\n**Note:** The Intel® Neural Compute Stick can only run FP16 models at this time. The model that is passed to the application, through the `-m \u003cpath_to_model\u003e` command-line argument, must be of data type FP16.\n\n#### Using a camera stream instead of a video file\n\nTo get the input video from the camera, use the `-i CAM` command-line argument. Specify the resolution of the camera using the `-video_size` command line argument.\n\nFor example:\n```\npython main.py -i CAM -m your-model.xml -l /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libcpu_extension_sse4.so -d CPU -pt 0.6 | ffmpeg -v warning -f rawvideo -pixel_format bgr24 -video_size 768x432 -framerate 24 -i - http://0.0.0.0:3004/fac.ffm\n```\n\nTo see the output on a web based interface, open the link [http://0.0.0.0:3004](http://0.0.0.0:3004/) in a browser.\n\n**Note:**\nUser has to give `-video_size` command line argument according to the input as it is used to specify the resolution of the video or image file.\n\n## A Note on Running Locally\n\nThe servers herein are configured to utilize the Udacity classroom workspace. As such,\nto run on your local machine, you will need to change the below file:\n\n```\nwebservice/ui/src/constants/constants.js\n```\n\nThe `CAMERA_FEED_SERVER` and `MQTT_SERVER` both use the workspace configuration. \nYou can change each of these as follows:\n\n```\nCAMERA_FEED_SERVER: \"http://localhost:3004\"\n...\nMQTT_SERVER: \"ws://localhost:3002\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajithvcoder%2Fpeople_counter_app_udacity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajithvcoder%2Fpeople_counter_app_udacity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajithvcoder%2Fpeople_counter_app_udacity/lists"}