├── .github
├── ISSUE_TEMPLATE
│ ├── bug-report.yml
│ └── feature-request.yml
└── workflows
│ └── welcome.yml
├── CNAME
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── index.html
├── script.js
└── styles.css
/.github/ISSUE_TEMPLATE/bug-report.yml:
--------------------------------------------------------------------------------
1 | name: Bug Report 🐞
2 | description: Bugs with PolygonZone
3 | labels: [bug]
4 | body:
5 | - type: markdown
6 | attributes:
7 | value: |
8 | Thank you for submitting a PolygonZone Bug Report!
9 |
10 | - type: checkboxes
11 | attributes:
12 | label: Search before asking
13 | description: >
14 | Please search the [issues](https://github.com/roboflow/polygonzone/issues) to see if a similar bug report already exists.
15 | options:
16 | - label: >
17 | I have searched the PolygonZone [issues](https://github.com/roboflow/polygonzone/issues) and found no similar bug report.
18 | required: true
19 |
20 | - type: textarea
21 | attributes:
22 | label: Bug
23 | description: Describe the issue that you are experiencing.
24 | placeholder: |
25 | 💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
26 | validations:
27 | required: true
28 |
29 | - type: textarea
30 | attributes:
31 | label: Environment
32 | description: Please specify the browser and resolution you are using.
33 | placeholder: |
34 | - Browser: [e.g. Chrome, Safari]
35 | - Resolution: [e.g. 1920x1080] (if your bug relates to the UI at a particular resolution)
36 | validations:
37 | required: false
38 |
39 | - type: textarea
40 | attributes:
41 | label: Steps to Reproduce
42 | description: >
43 | Please provide a list of steps that can be followed to reproduce the bug you have encountered. If a bug is only present when an image is at a particular resolution, note the characteristics of the image (e.g. size, aspect ratio, etc.).
44 | placeholder: |
45 | ```
46 | # Steps to Reproduce
47 | ```
48 | validations:
49 | required: false
50 |
51 | - type: textarea
52 | attributes:
53 | label: Additional Information
54 | description: Anything else you would like to share?
55 |
56 | - type: checkboxes
57 | attributes:
58 | label: Are you willing to submit a PR?
59 | description: >
60 | (Optional) We encourage you to submit a [Pull Request](https://github.com/roboflow/polygonzone/pulls) (PR) to help improve PolygonZone for everyone, especially if you have a good understanding of how to implement a fix or a new feature.
61 | options:
62 | - label: Yes I'd like to help by submitting a PR!
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.yml:
--------------------------------------------------------------------------------
1 | name: 🤩 Feature Request
2 | description: Suggest a PolygonZone idea
3 | # title: " "
4 | labels: [enhancement]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | Thank you for submitting a PolygonZone 🤩 Feature Request!
10 |
11 | - type: checkboxes
12 | attributes:
13 | label: Search before asking
14 | description: >
15 | Please search the [issues](https://github.com/roboflow/polygonzone/issues) to see if a similar feature request already exists.
16 | options:
17 | - label: >
18 | I have searched the PolygonZone [issues](https://github.com/roboflow/polygonzone/issues) and found no similar feature requests.
19 | required: true
20 |
21 | - type: textarea
22 | attributes:
23 | label: Description
24 | description: A short description of your feature.
25 | placeholder: |
26 | What new feature would you like to see in PolygonZone?
27 | validations:
28 | required: true
29 |
30 | - type: textarea
31 | attributes:
32 | label: Use case
33 | description: |
34 | Describe the use case of your feature request. It will help us understand and prioritize the feature request.
35 | placeholder: |
36 | How would this feature be used, and who would use it?
37 |
38 | - type: textarea
39 | attributes:
40 | label: Additional
41 | description: Anything else you would like to share?
42 |
43 | - type: checkboxes
44 | attributes:
45 | label: Are you willing to submit a PR?
46 | description: >
47 | (Optional) We encourage you to submit a [Pull Request](https://github.com/roboflow/polygonzone/pulls) (PR) to help improve PolygonZone for everyone, especially if you have a good understanding of how to implement a fix or feature.
48 | options:
49 | - label: Yes I'd like to help by submitting a PR!
--------------------------------------------------------------------------------
/.github/workflows/welcome.yml:
--------------------------------------------------------------------------------
1 | name: Welcome WorkFlow
2 |
3 | on:
4 | issues:
5 | types: [opened]
6 | pull_request_target:
7 | types: [opened]
8 |
9 | jobs:
10 | build:
11 | name: 👋 Welcome
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/first-interaction@v1.1.1
15 | with:
16 | repo-token: ${{ secrets.GITHUB_TOKEN }}
17 | issue-message: "Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you soon."
18 | pr-message: "Hello there, thank you for opening an PR ! 🙏🏻 The team was notified and they will get back to you soon."
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | polygonzone.roboflow.com
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to PolygonZone 🛠️
2 |
3 | Thank you for your interest in contributing to PolygonZone!
4 |
5 | Our goal with PolygonZone is to solve a problem that comes up time and time again in computer vision: figuring out the coordinates of a polygon that you want to draw on an image, a particular issue when you're trying to mark zones of interest in an image.
6 |
7 | ## Contribution Guidelines
8 |
9 | We welcome contributions to:
10 |
11 | 1. Add a new feature to the web application (see more below).
12 | 3. Report bugs and issues in the project.
13 | 4. Submit a request for a new feature.
14 |
15 | ### Contributing Features
16 |
17 | PolygonZone is specifically designed to make it easy to retrieve the coordinates of a polygon that you want to draw on an image. If you have a feature that you think would: (i) improve the drawing experience; (ii) improve the general user experience; (iii) provide new import export functionalities or; (iv) otherwise improve PolygonZone, please submit an Issue to discuss the feature so the community can weigh in and assist.
18 |
19 | ## How to Contribute Changes
20 |
21 | First, fork this repository to your own GitHub account. Create a new branch that describes your changes (i.e. `show-coordinates`). Push your changes to the branch on your fork and then submit a pull request to this repository.
22 |
23 | When creating new functions, please ensure you have the following:
24 |
25 | 1. Comments where necessary that make it easier to understand how your code works.
26 | 2. A written test that the project maintainers can follow to verify your code works as expected.
27 |
28 | All pull requests will be reviewed by the maintainers of the project. We will provide feedback and ask for changes if necessary.
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Roboflow
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
53 |
54 |
55 | ## About PolygonZone 📐
56 |
57 | PolygonZone lets you draw arbitrary polygons on an image and retrieve the coordinates of the points you have drawn.
58 |
59 | This application makes it easy to retrieve coordinates for Regions of Interest in computer vision applications.
60 |
61 | PolygonZone accompanies [Roboflow Supervision](https://github.com/roboflow/supervision), a Python library with a range of utilities that are useful in computer vision projects.
62 |
63 | Please note that PolygonZone is not an annotation tool. It is a tool for retrieving coordinates of polygons that you have drawn on an image.
64 |
65 | This application is designed for desktop use.
66 |
67 | ## Demo
68 |
69 | https://user-images.githubusercontent.com/37276661/218796838-3a66a61c-ac9d-40f5-97ff-0030a8bdc60d.mov
70 |
71 | ## Getting Started 🚀
72 |
73 | To use PolygonZone, open up the [PolygonZone web application](https://roboflow.github.io/polygonzone/). Then:
74 |
75 | 1. Upload an image onto which you want to draw a polygon.
76 | 2. Click on the points where you want to draw the polygon.
77 | 3. Click on the intial point or press "Enter" to save a polygon.
78 | 4. Continue to draw as many polygons as you need.
79 | 5. Copy the NumPy array or JSON object that contains the coordinates of the polygons you have drawn.
80 |
81 | ## Functionalities
82 | - You can zoom in and out of an image using the mouse wheel or a laptop track pad.
83 | - You can undo the last point pressing Ctrl/Cmd+Z
84 | - You can discard the last unsaved polygon pressing Esc
85 |
86 | ## Contributing 🤝
87 |
88 | We welcome contributions to the PolygonZone project. Please see the [Contributing Guidelines](CONTRIBUTING.md) for more information on how you can help to improve this project.
89 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | PolygonZone by Roboflow
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
38 |
39 |
40 |
41 |
PolygonZone
42 |
PolygonZone lets you calculate polygon points in an image.
43 |
How to use
44 |
45 |
Drop an image to the indicated area
46 |
Select the desired mode: Press L to draw a line, or P to draw a polygon
47 |
Click to draw polygon points. Press enter to finish the polygon.
48 |
49 |
Coordinates
50 |
Copy the points below, formatted as NumPy arrays, into your Python code.