{"id":21885024,"url":"https://github.com/saeidemadi/dcproj","last_synced_at":"2026-02-11T23:42:02.519Z","repository":{"id":235513087,"uuid":"779684590","full_name":"saeidEmadi/DCProj","owner":"saeidEmadi","description":"Traffic detection and notify C\u0026C (prototype)","archived":false,"fork":false,"pushed_at":"2024-06-10T12:45:51.000Z","size":51946,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T14:48:45.414Z","etag":null,"topics":["network","network-programming","object-detection","object-oriented-programming","socket","socket-programming","student-project","traffic","traffic-control","udp","yolo","yolov9"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saeidEmadi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-30T14:13:43.000Z","updated_at":"2024-06-10T12:45:55.000Z","dependencies_parsed_at":"2025-06-11T21:18:26.706Z","dependency_job_id":null,"html_url":"https://github.com/saeidEmadi/DCProj","commit_stats":null,"previous_names":["saeidemadi/dcproj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saeidEmadi/DCProj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeidEmadi%2FDCProj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeidEmadi%2FDCProj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeidEmadi%2FDCProj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeidEmadi%2FDCProj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saeidEmadi","download_url":"https://codeload.github.com/saeidEmadi/DCProj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saeidEmadi%2FDCProj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29349640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T20:11:40.865Z","status":"ssl_error","status_checked_at":"2026-02-11T20:10:41.637Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["network","network-programming","object-detection","object-oriented-programming","socket","socket-programming","student-project","traffic","traffic-control","udp","yolo","yolov9"],"created_at":"2024-11-28T10:18:23.478Z","updated_at":"2026-02-11T23:42:02.501Z","avatar_url":"https://github.com/saeidEmadi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DCProj\n\u003e ### Traffic detection and notify C\u0026amp;C (prototype)\n\n## Description\n\u003e In this project(demo stage) \\\nwe have tried to detect the traffic in the simplest way \\\nusing city traffic cameras and inform the control center.\n\n\u003e In this project, we have tried to detect the vehicles by using ***[Yolo](https://pjreddie.com/darknet/yolo/) (You Only Look Once)*** architecture,\\\nand we have informed the control center about the current state by considering \\\nthe current traffic volume in the desired route. \\\nIn this project, we have used \\\nYolo [V9](https://github.com/WongKinYiu/yolov9) ,\\\nUDP protocol, \\\nand the network has been defined locally\n\n\n## Getting Started\n\n### Dependencies\n- [ ] virtual environment   \n \u003e We need to run a separate virtual environment to install packages and run them, the following suggested code to create a `.venv`\n```sh\n $ python -m venv .venv\n```\n- [ ] [clone Project](https://github.com/saeidEmadi/DCProj.git)\n- [ ] make [config.ini](#configini) file\n- [ ] install `pip` requirements\n- [ ]  add videos in directory\n```sh\n $ pip install -r requirements.txt\n```\n- [ ] Executing program\n\n### Executing Program\n- `Virtual Environment`  activate a virtual environment\n```bash\n # linux bash\n $ source .venv/bin/activate\n ```\n ```bash\n  # windows CMD\n  \u003e .venv\\Scripts\\activate\n```\n\n- [`driver.py`](#driver)\n```sh\n $ python driver.py --help\n```\n* [`server.py`](#server)\n```sh\n $ python server.py --help\n```\n* [define camera's (add videos)](#videoController)\n```sh\n $ python videoController.py --help\n```\n* simulator run *`just only test [debug mode : enable]`*\n```sh\n $ python driver.py 0 0 --test --device cuda:0\n```\n\n# Help. Code Usage\n\n## ***`config.ini`***\n#### ```config.ini```\n\u003e rename config.ini.example to config.ini  \n\u003e We use this to set some default settings   \n\n\u003e * `Traffic Camera`   \n\u003e    + `yoloVersion` To determine the yolo version  \n   **Params :** `yolov9e`,`yolov9t`,`yolov9s`,`yolov9m`,`yolov9c`\n\u003e   + `confidence` Sets the minimum confidence threshold for detections. Objects detected with confidence below this threshold will be disregarded. Adjusting this value can help reduce false positives.     \n**Params :** `float`\n\n\u003e * `Server`   \n\u003e   * `server IP` IP address for connecting clients to the server    \n    **Params :** `IPV4`, `IPV6`\n\u003e   * `port` Server Port number for connection  \n    **Params :** `Port Valid number`         \n\u003e    * `backlogListenVal` It specifies the number of unaccepted connections  \nthat the system will allow before refusing new connections  \n    **Params :** `Integer Value (max : 100)`\n\n\u003e * `DEBUG`\n\u003e   * `debug mode` Enable debug mode and show system logs    \n    **Params :** `True or False`\n```bash\n[Traffic Camera]\nyoloVersion = YOLO_VERSION\nconfidence = YOLO_CONFIDENCE\n\n[Server]\nserver IP = IP_ADDRESS\nport = PORT_NUMBER\nbacklogListenVal = IntegerValue \n#It specifies the number of unaccepted connections\n#that the system will allow before refusing new connections\n\n[DEBUG]\ndebug mode = BOOLEAN VALUE | True or False\n```\n## ***`driver`***\n#### `driver.py`\n\u003e ### Starting the simulation and setting up the server and clients (cameras)    \n\n\u003e * ***`positional arguments`***    \n \u003e      * `host`   IP address for connecting clients to the server    \n    **Params :** `IPV4`, `IPV6`\n    **Default :** `Config.ini value`\n \u003e   * `port` Server Port number for connection  \n    **Params :** `Port Valid number`        \n    **Default :** `Config.ini value`\n\n\u003e * ***`options`***   *optional values*   \n\u003e If these options are not selected, the default values will be replaced (the default values are in the description)   \n\u003e      *  `-h`,`--help` show this help message and exit\n\u003e      * `-v`,`--yolov` To determine the version of yolo   \n\u003e   **Params :** `yolov9e`,`yolov9t`,`yolov9s`,`yolov9m`,`yolov9c`\n\u003e      **Default :** `yolov9e`\n\u003e      * `-yc`,`--yoloConf` Sets the minimum confidence threshold for detections.   \n  Objects detected with confidence below this threshold will be disregarded. Adjusting this value can help reduce false positives.     \n**Params :** `float`\n**Default :** `0.6`\n\u003e      * `-tc`,`--trafficConf` Sets the minimum confidence threshold for Traffic.  \n   Objects `(vehicles)` count with confidence below this threshold will be disregarded. Adjusting this value can help reduce false positives.     \n**Params :** `Integer Value (min : 3)`    \n**Default :** `8`\n\u003e      * `-d`,`--detect` labels for model detection     \nusing ms coco : MS Common Objects in Context   \n\u003e   **Params :** `str list lables` [MS-COCO list](https://github.com/saeidEmadi/DCProj/blob/main/trafficCamera/msCocoLablesPaper.txt) , `all`,`vehicles`\n**Default :** `vehicles`\n\u003e     * `-c`,`--client` Used to specify the number of clients (cameras)\n**Params :** `Integer Value (min : 1)`    \n**Default :**  `5`\n\u003e      + `--test` This ***flag*** is used for simulation testing (default values)\n         **Params :** `True or False`\n         **Default :**  `False | if call : True`         \n\u003e    + `--stream` stream traffic camera real-Time\n         **Params :** `True or False`\n         **Default :**  `False | if call : True`         \n\u003e     + `--debug` show CLI logs\n         **Params :** `True or False`\n         **Default :**  `False | if call : True`         \n\u003e     + `--device` yolo gpu core or CPU \n\u003e              **Params :** `0`,`1`,`2`,`3`,`cuda:0`,`cuda:1`,`cuda:2`,`cuda:3`,`cpu`\n         **Default :**  `cpu`         \n```sh\n $ python driver.py --help\n \u003e usage: driver.py [-h] [-v yoloVersion] [-yc yoloConf] [-tc trafficConf]\n                  [-d [coco class name's ...]] [-c INT] [--test] [--stream]\n                  [--debug] --device core\n                  host port\n\n   positional arguments:\n     host                  Server Address for listening clients\n     port                  port number\n \n   options:\n     -h, --help            show this help message and exit\n     -v yoloVersion, --yolov yoloVersion\n                           Yolo pre-Train Model version (default : yolov9e)\n     -yc yoloConf, --yoloConf yoloConf\n                           Yolo pre-Train Model confidence (default : 0.6)\n     -tc trafficConf, --trafficConf trafficConf\n                           traffic Max confidence (default : 8)\n     -d [coco class name's ...], --detect [coco class name's ...]\n                           detect all objects in ms-COCO or only vehicles\n                           (example : vehicles person [etc.]], default =\n                           vehicles)\n     -c INT, --client INT  number of clients ,[default = 5]\n     --test                flag for Enable defaults parameters run :: 127.0.0.1\n                           1919 -v yolov9e, -c 5\n     --stream              stream traffic camera real-Time\n     --debug               flag for Enable Debug mode [show CLI logs]\n     --device core         yolo gpu core or CPU [ex. cpu , cuda:0]\n\n```\n## ***`server`***\n#### `server.py`\n\u003e ### Running a server to receive data and connect clients\n\n\u003e * ***`positional arguments`***    \n \u003e      * `host`   IP address for connecting clients to the server    \n    **Params :** `IPV4`, `IPV6`\n    **Default :** `Config.ini value`\n \u003e   * `port` Server Port number for connection  \n    **Params :** `Port Valid number`        \n    **Default :** `Config.ini value`\n\n\u003e * ***`options`***   *optional values*   \n\u003e If these options are not selected, the default values will be replaced (the default values are in the description)   \n\u003e      *  `-h`,`--help` show this help message and exit\n\u003e      + `--test` This ***flag*** is used for simulation testing (default values)\n         **Params :** `True or False`\n         **Default :**  `False | if call : True`         \n\u003e     + `--debug` show CLI logs\n         **Params :** `True or False`\n         **Default :**  `False | if call : True`         \n```sh\n $ python server.py --help\n \u003e [Server Running : CLI Mode]\n   usage: Server [-h] [--test] [--debug] host port\n   \n   Server runner Script | run script for receive Camera Packets\n   positional arguments:\n     host        Server Address for listening clients\n     port        port number\n\n   options:\n     -h, --help  show this help message and exit\n     --test      flag for Enable defaults parameters run :: 127.0.0.1 1919\n     --debug     flag for Enable Debug mode [show CLI logs]\n\n```\n## ***`trafficCamera\\runMain`***\n#### `trafficCamera\\runMain.py` \n\u003e ### Development act.\n```python\n # import library \nIn [1]: from trafficCamera.runMain import Camera\n\nIn [2]: camera = Camera(serverIP='127.0.0.1', portNumber=1919, yoloVersion='yolov9e',show=False,device='cuda:0',detecti\n   ...: onLabels=['vehicles'],yoloConf=0.6,trafficConf=8,stream=False,DEBUG=True)\n Camera : convert class Names : ['bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', 'truck', 'boat']\n Camera : to\n Camera : [1, 2, 3, 4, 5, 6, 7, 8]\n\n++[new Camera object]++\n\n Camera : [server IP : 127.0.0.1]\n[ Camera Port Number : 1919]\n Camera : [yolo Version : yolov9e.pt]\n Camera : [detection Labels : ['bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', 'truck', 'boat']]\n Camera : [detection : [1, 2, 3, 4, 5, 6, 7, 8]]\n Camera : [yolo conf : 0.6]\n Camera : [traffic conf : 8]\n\n```\n## ***`videoController`***\n#### `videoController.py` \n\u003e ###  We use it to transfer and add videos used by clients (cameras)\n\n\u003e * ***`positional arguments`***    \n \u003e      * `source address`   video source address (folder or video name)\n    **Params :** `Path (String)`\n\n\n\u003e * ***`options`***   *optional values*   \n\u003e If these options are not selected, the default values will be replaced (the default values are in the description)   \n\u003e      *  `-h`,`--help` show this help message and exit\n\u003e      * `-d`,`--dest` video destination address folder (video folder)\n\u003e     **Params :** `Path (String)`\n\u003e      **Default :** `'.'` *current folder*\n\u003e      * `-f`,`--format` find this formats in directory\n**Params :** `.mp4`,`.mkv`,`other video format`\n**Default :** `.mp4`\n```sh \n $ python videoController.py --help\n \u003e [ video controller Running : CLI Mode]\n   usage: videoController [-h] [--dest destination address] --format format\n                          [format ...]\n                          source address\n\n   video controller runner Script | run script for input controlling video for\n   camera's\n\n   positional arguments:\n     source address        video source address (folder or video name)\n\n   options:\n     -h, --help            show this help message and exit\n     --dest destination address, -d destination address\n                           video destination address folder (video folder)\n     --format format [format ...], -f format [format ...]\n                           find this formats in directory [.mp4|.mkv|etc]\n\n```\n\n## Authors\n\n\u003e Contributors names and contact info\n\n[@Amir Reza](https://github.com/Amirreza-Afra)\n\n## Version History\n\n\n * 0.1\n   \u003e This version is only a prototype and a student project\n\n## License\n\n\u003e This project is licensed under the Apache-2.0 License - see the LICENSE.md file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeidemadi%2Fdcproj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaeidemadi%2Fdcproj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeidemadi%2Fdcproj/lists"}