-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
thinhphanuark
committed
Sep 13, 2024
0 parents
commit 1569da3
Showing
273 changed files
with
19,411 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
exclude = .*/ | ||
ignore = E203, E741, W503, W504 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [wkentaro] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Bug Report | ||
description: Create a bug report | ||
labels: 'bug' | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. | ||
- type: markdown | ||
attributes: | ||
value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions ["Q&A / Help" section](https://github.com/wkentaro/labelme/discussions/categories/q-a-help). | ||
- type: textarea | ||
attributes: | ||
label: Provide environment information | ||
description: Please run `which python; python --version; python -m pip list | grep labelme` in the root directory of your project and paste the results. | ||
validations: | ||
required: true | ||
- type: input | ||
attributes: | ||
label: What OS are you using? | ||
description: 'Please specify the exact version. For example: macOS 12.4, Ubuntu 20.04.4' | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: Describe the Bug | ||
description: A clear and concise description of what the bug is. | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: Expected Behavior | ||
description: A clear and concise description of what you expected to happen. | ||
- type: textarea | ||
attributes: | ||
label: To Reproduce | ||
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken. | ||
- type: markdown | ||
attributes: | ||
value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. | ||
- type: markdown | ||
attributes: | ||
value: Contributors should be able to follow the steps provided in order to reproduce the bug. | ||
- type: markdown | ||
attributes: | ||
value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
contact_links: | ||
- name: Ideas / Feature request | ||
url: https://github.com/wkentaro/labelme/discussions/categories/ideas-feature-requests | ||
about: Share ideas for new features | ||
- name: Q&A / Help | ||
url: https://github.com/wkentaro/labelme/discussions/categories/q-a-help | ||
about: Ask the community for help | ||
- name: Show and tell | ||
url: https://github.com/wkentaro/labelme/discussions/categories/show-and-tell | ||
about: Show off something you've made |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
python-version: ['3.9'] | ||
PYTEST_QT_API: [pyqt5, pyside2] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# - name: Install system dependencies | ||
# shell: bash -l {0} | ||
# run: | | ||
# if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
# sudo apt-get install -y coreutils | ||
# sudo apt-get install -y xvfb herbstluftwm | ||
# elif [ "${{ matrix.os }}" = "macos-latest" ]; then | ||
# brew install coreutils | ||
# brew install --cask xquartz | ||
# fi | ||
|
||
- name: Set up Python | ||
shell: bash -l {0} | ||
run: | | ||
conda install -q -y python=${{ matrix.python-version }} | ||
which python | ||
python --version | ||
pip --version | ||
- name: Install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
if [ "${{ matrix.PYTEST_QT_API }}" = "pyside2" ]; then | ||
conda install -q -y pyside2 -c conda-forge | ||
# should be installed via pip | ||
# else | ||
# conda install -q -y pyqt=5 | ||
fi | ||
pip install -r requirements-dev.txt | ||
- name: Install main | ||
shell: bash -l {0} | ||
run: | | ||
pip install . | ||
- name: Run ruff | ||
shell: bash -l {0} | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
ruff format --check | ||
ruff check | ||
- name: Test with pytest | ||
shell: bash -l {0} | ||
if: matrix.os == 'ubuntu-latest' | ||
env: | ||
PYTEST_QT_API: ${{ matrix.PYTEST_QT_API }} | ||
MPLBACKEND: 'agg' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y xvfb libqt5widgets5 | ||
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
export DISPLAY=:99 | ||
pytest tests | ||
- name: Run examples | ||
shell: bash -l {0} | ||
if: matrix.os != 'windows-latest' | ||
env: | ||
MPLBACKEND: agg | ||
run: | | ||
labelme --help | ||
labelme --version | ||
(cd examples/primitives && labelme_json_to_dataset primitives.json && rm -rf primitives_json) | ||
(cd examples/tutorial && rm -rf apc2016_obj3_json && labelme_json_to_dataset apc2016_obj3.json && python load_label_png.py && git checkout -- .) | ||
(cd examples/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .) | ||
(cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .) | ||
(cd examples/video_annotation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .) | ||
pip install 'lxml<5.0.0' # for bbox_detection/labelme2voc.py | ||
(cd examples/bbox_detection && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .) | ||
pip install cython && pip install pycocotools # for instance_segmentation/labelme2coco.py | ||
(cd examples/instance_segmentation && rm -rf data_dataset_coco && ./labelme2coco.py data_annotated data_dataset_coco --labels labels.txt && git checkout -- .) | ||
- name: Run pyinstaller | ||
shell: bash -l {0} | ||
if: matrix.PYTEST_QT_API == 'pyqt5' | ||
run: | | ||
# Build the standalone executable | ||
pip install pyinstaller | ||
pyinstaller labelme.spec | ||
dist/labelme --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
configurationJson: | | ||
{ | ||
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>\n\n- Tips and updates→ [X/Twitter <@labelmeai>](https://x.com/labelmeai)\n- Labelme Starter Bundle→ https://labelme.gumroad.com/l/starter-bundle", | ||
"pr_template": "- #{{TITLE}} ##{{NUMBER}}", | ||
"categories": [ | ||
{ | ||
"title": "## 🚀 Features", | ||
"labels": ["feature"] | ||
}, | ||
{ | ||
"title": "## ✨ Enhancement", | ||
"labels": ["enhancement"] | ||
}, | ||
{ | ||
"title": "## 🐛 Fixes", | ||
"labels": ["fix"] | ||
}, | ||
{ | ||
"title": "## 💬 Other", | ||
"labels": ["other"] | ||
} | ||
] | ||
} | ||
- name: Create Release | ||
id: create_release | ||
uses: mikepenz/[email protected] | ||
with: | ||
body: ${{steps.github_release.outputs.changelog}} | ||
|
||
- name: Create release url file | ||
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | ||
|
||
- name: Save release url file for publish | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: release_url | ||
path: release_url.txt | ||
|
||
publish: | ||
needs: [release] | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: '3.7' | ||
|
||
- name: Install main | ||
shell: bash -l {0} | ||
run: | | ||
pip install . | ||
- name: Run pyinstaller | ||
shell: bash -l {0} | ||
run: | | ||
pip install pyinstaller | ||
pyinstaller labelme.spec | ||
- name: Load release url file from release job | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: release_url | ||
|
||
- name: Get release file name & upload url | ||
id: get_release_info | ||
run: | | ||
echo "::set-output name=upload_url::$(cat release_url/release_url.txt)" | ||
- name: Upload release executable on macOS & Linux | ||
id: upload_release_executable_macos_linux | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ./dist/labelme | ||
asset_name: labelme-${{ runner.os }} | ||
asset_content_type: application/octet-stream | ||
if: runner.os != 'Windows' | ||
|
||
- name: Upload release executable on Windows | ||
id: upload_release_executable_windows | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ./dist/labelme.exe | ||
asset_name: Labelme.exe | ||
asset_content_type: application/octet-stream | ||
if: runner.os == 'Windows' | ||
|
||
- name: Create dmg for macOS | ||
run: | | ||
npm install -g create-dmg | ||
cd dist | ||
create-dmg Labelme.app || test -f Labelme\ 0.0.0.dmg | ||
mv Labelme\ 0.0.0.dmg Labelme.dmg | ||
if: runner.os == 'macOS' | ||
|
||
- name: Upload release app on macOS | ||
id: upload_release_app_macos | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ./dist/Labelme.dmg | ||
asset_name: Labelme.dmg | ||
asset_content_type: application/octet-stream | ||
if: runner.os == 'macOS' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/.cache/ | ||
/.pytest_cache/ | ||
|
||
/build/ | ||
/dist/ | ||
/*.egg-info/ | ||
|
||
*.py[cdo] | ||
|
||
.DS_Store | ||
.idea/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use this software, please cite it as below." | ||
authors: | ||
- family-names: "Wada" | ||
given-names: "Kentaro" | ||
orcid: "https://orcid.org/0000-0002-6347-5156" | ||
title: "Labelme: Image Polygonal Annotation with Python" | ||
doi: 10.5281/zenodo.5711226 | ||
url: "https://github.com/wkentaro/labelme" | ||
license: GPL-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Copyright (C) 2016-2018 Kentaro Wada. | ||
Copyright (C) 2011 Michael Pitidis, Hussein Abdulwahid. | ||
|
||
Labelme is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
Labelme is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with Labelme. If not, see <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
all: | ||
@echo '## Make commands ##' | ||
@echo | ||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs | ||
|
||
lint: | ||
ruff format --check | ||
ruff check | ||
|
||
format: | ||
ruff format | ||
ruff check --fix | ||
|
||
test: | ||
MPLBACKEND='agg' pytest tests |
Oops, something went wrong.