{"id":21405820,"url":"https://github.com/memona008/polygon_manager","last_synced_at":"2025-03-16T17:12:41.810Z","repository":{"id":44573363,"uuid":"432216142","full_name":"memona008/Polygon_Manager","owner":"memona008","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-07T17:36:26.000Z","size":25,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T09:35:57.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/polygon-manager/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/memona008.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-26T15:02:31.000Z","updated_at":"2021-12-14T18:05:49.000Z","dependencies_parsed_at":"2022-08-29T05:30:10.153Z","dependency_job_id":null,"html_url":"https://github.com/memona008/Polygon_Manager","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memona008%2FPolygon_Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memona008%2FPolygon_Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memona008%2FPolygon_Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memona008%2FPolygon_Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memona008","download_url":"https://codeload.github.com/memona008/Polygon_Manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902293,"owners_count":20366260,"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-22T16:28:31.697Z","updated_at":"2025-03-16T17:12:41.787Z","avatar_url":"https://github.com/memona008.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polygon Manager\n\n[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)]()\n\n## Features\n\n- Create a dictionary containing polygon points\n- View drawn polygons\n- Get polygon points and use it anywhere\n\n\n## Tech\n\nPolygon Manager only uses a number of open source projects to work properly:\n\n- [Numpy] \n- [OpenCV]\n- [Shapely] \n\nAnd of course Polygon Manager itself is open source with a [https://github.com/memona008/Polygon_Manager][poly]\n on GitHub.\n\n## Installation\n\nInstall the package with entering this command in command line interface\n\n```\npip3 install polygon_manager==0.1.2\n```\n\n## Usage\n#### Create an object of Polygon Manager it will create a pkl file in root folder \n```\nfrom polygon_manager import PolygonManager\npm = PolygonManager()\n```\n\n#### To create/edit a polygon \n```\npm.create_new_polygon(camera_no='10', vid_path='/path/to/video/')\n```\n\nIt will open a window with first frame of video where you can add points Clockwise or Anti-Clockwise by clicking on picture. To undo the recent added point; use right click. \n\n![Polygon Points](https://user-images.githubusercontent.com/43179211/143847530-2734a4f2-a94a-4456-818b-cad84e8d904f.PNG)\n\n\n#### To view all polygons\n```\npm.view_polygons()\n```\n\n#### To view some specific polygon pass the camera name/number\n```\npm.view_polygons('10')\n```\n\n![Drawn_Polygon](https://user-images.githubusercontent.com/43179211/143847634-a0055a49-48fd-491b-bc69-27882ecc726d.PNG)\n\n\n#### To delete an existing polygon \n```\npm.delete_polygon('10')\n```\n\nIt will return True or False based on deletion of polygon. And will throw exception if the polygon doesn't exist\n\n\n#### To check if a point lies in polygon or not \n```\npm.is_point_in_polygon(point=(1,2),polygon_name='10')\n```\n\nIt will return True or False based on point position in polygon. And will throw exception if the polygon doesn't exist\n\n\n#### To get polygon points to use it anywhere else \n```\npm.get_polygon_points('10')\n```\nFor example: [[32, 667], [279, 559], [551, 462], [766, 380], [972, 286], [1191, 204], [1407, 265], [1179, 412], [955, 531], [738, 664], [513, 817], [185, 1007]]\n\n#### To Calculate IOU/Intersection of boxes over POLYGON\n***Different formats of boxes can be used\nSupported formats: XYXY, XYWH***\n```\npm.box_to_poly_iou(bbox_list=[[515, 149, 621, 286],[654, 159, 721, 186]], '13', mode=pm.BOX_MODE_XYXY)\npm.box_to_poly_iou(bbox_list=[[568.0000, 217.5000, 106.0000, 137.0000]], '13', mode=pm.BOX_MODE_XYWH)\n```\nFor example: [0.08, 0.44]\n             [0.78]\n\n\n\n\n   [poly]: \u003chttps://github.com/memona008/Polygon_Manager\u003e\n\n\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemona008%2Fpolygon_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemona008%2Fpolygon_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemona008%2Fpolygon_manager/lists"}