pax_global_header 0000666 0000000 0000000 00000000064 14546257460 0014527 g ustar 00root root 0000000 0000000 52 comment=53c4a5c6ab0e57077ba281d64f5f875f4d96346b
labelme-5.4.1/ 0000775 0000000 0000000 00000000000 14546257460 0013137 5 ustar 00root root 0000000 0000000 labelme-5.4.1/.flake8 0000664 0000000 0000000 00000000067 14546257460 0014315 0 ustar 00root root 0000000 0000000 [flake8]
exclude = .*/
ignore = E203, E741, W503, W504
labelme-5.4.1/.github/ 0000775 0000000 0000000 00000000000 14546257460 0014477 5 ustar 00root root 0000000 0000000 labelme-5.4.1/.github/FUNDING.yml 0000664 0000000 0000000 00000001456 14546257460 0016322 0 ustar 00root root 0000000 0000000 # 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']
labelme-5.4.1/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14546257460 0016662 5 ustar 00root root 0000000 0000000 labelme-5.4.1/.github/ISSUE_TEMPLATE/1.bug_report.yml 0000664 0000000 0000000 00000004344 14546257460 0021721 0 ustar 00root root 0000000 0000000 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!
labelme-5.4.1/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000720 14546257460 0020651 0 ustar 00root root 0000000 0000000 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
labelme-5.4.1/.github/workflows/ 0000775 0000000 0000000 00000000000 14546257460 0016534 5 ustar 00root root 0000000 0000000 labelme-5.4.1/.github/workflows/ci.yml 0000664 0000000 0000000 00000007176 14546257460 0017665 0 ustar 00root root 0000000 0000000 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
labelme-5.4.1/.github/workflows/release.yml 0000664 0000000 0000000 00000010263 14546257460 0020701 0 ustar 00root root 0000000 0000000 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\nUncategorized
\n\n#{{UNCATEGORIZED}}\n
VOC dataset example of instance segmentation.
Other examples (semantic segmentation, bbox detection, and classification).
Various primitives (polygon, rectangle, circle, line, and point).
## Features
- [x] Image annotation for polygon, rectangle, circle, line and point. ([tutorial](examples/tutorial))
- [x] Image flag annotation for classification and cleaning. ([#166](https://github.com/wkentaro/labelme/pull/166))
- [x] Video annotation. ([video annotation](examples/video_annotation))
- [x] GUI customization (predefined labels / flags, auto-saving, label validation, etc). ([#144](https://github.com/wkentaro/labelme/pull/144))
- [x] Exporting VOC-format dataset for semantic/instance segmentation. ([semantic segmentation](examples/semantic_segmentation), [instance segmentation](examples/instance_segmentation))
- [x] Exporting COCO-format dataset for instance segmentation. ([instance segmentation](examples/instance_segmentation))
## Starter Bundle
If you're new to Labelme, you can get started with [Labelme Starter Bundle](https://labelme.gumroad.com/l/starter-bundle) (FREE), which contains:
- **Installation guides** for all platforms: Windows, macOS, and Linux 💻
- **Step-by-step tutorials**: first annotation to editing, exporting, and integrating with other programs 📕
- **A compilation of valuable resources** for further exploration 🔗.
## Installation
There are options:
- Platform agnostic installation: [Anaconda](#anaconda)
- Platform specific installation: [Ubuntu](#ubuntu), [macOS](#macos), [Windows](#windows)
- Pre-build binaries from [the release section](https://github.com/wkentaro/labelme/releases)
### Anaconda
You need install [Anaconda](https://www.continuum.io/downloads), then run below:
```bash
# python3
conda create --name=labelme python=3
source activate labelme
# conda install -c conda-forge pyside2
# conda install pyqt
# pip install pyqt5 # pyqt5 can be installed via pip on python3
pip install labelme
# or you can install everything by conda command
# conda install labelme -c conda-forge
```
### Ubuntu
```bash
sudo apt-get install labelme
# or
sudo pip3 install labelme
# or install standalone executable from:
# https://github.com/wkentaro/labelme/releases
```
### macOS
```bash
brew install pyqt # maybe pyqt5
pip install labelme
# or
brew install wkentaro/labelme/labelme # command line interface
# brew install --cask wkentaro/labelme/labelme # app
# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases
```
### Windows
Install [Anaconda](https://www.continuum.io/downloads), then in an Anaconda Prompt run:
```bash
conda create --name=labelme python=3
conda activate labelme
pip install labelme
# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases
```
## Usage
Run `labelme --help` for detail.
The annotations are saved as a [JSON](http://www.json.org/) file.
```bash
labelme # just open gui
# tutorial (single image example)
cd examples/tutorial
labelme apc2016_obj3.jpg # specify image file
labelme apc2016_obj3.jpg -O apc2016_obj3.json # close window after the save
labelme apc2016_obj3.jpg --nodata # not include image data but relative image path in JSON file
labelme apc2016_obj3.jpg \
--labels highland_6539_self_stick_notes,mead_index_cards,kong_air_dog_squeakair_tennis_ball # specify label list
# semantic segmentation example
cd examples/semantic_segmentation
labelme data_annotated/ # Open directory to annotate all images in it
labelme data_annotated/ --labels labels.txt # specify label list with a file
```
### Command Line Arguments
- `--output` specifies the location that annotations will be written to. If the location ends with .json, a single annotation will be written to this file. Only one image can be annotated if a location is specified with .json. If the location does not end with .json, the program will assume it is a directory. Annotations will be stored in this directory with a name that corresponds to the image that the annotation was made on.
- The first time you run labelme, it will create a config file in `~/.labelmerc`. You can edit this file and the changes will be applied the next time that you launch labelme. If you would prefer to use a config file from another location, you can specify this file with the `--config` flag.
- Without the `--nosortlabels` flag, the program will list labels in alphabetical order. When the program is run with this flag, it will display labels in the order that they are provided.
- Flags are assigned to an entire image. [Example](examples/classification)
- Labels are assigned to a single polygon. [Example](examples/bbox_detection)
### FAQ
- **How to convert JSON file to numpy array?** See [examples/tutorial](examples/tutorial#convert-to-dataset).
- **How to load label PNG file?** See [examples/tutorial](examples/tutorial#how-to-load-label-png-file).
- **How to get annotations for semantic segmentation?** See [examples/semantic_segmentation](examples/semantic_segmentation).
- **How to get annotations for instance segmentation?** See [examples/instance_segmentation](examples/instance_segmentation).
## Examples
* [Image Classification](examples/classification)
* [Bounding Box Detection](examples/bbox_detection)
* [Semantic Segmentation](examples/semantic_segmentation)
* [Instance Segmentation](examples/instance_segmentation)
* [Video Annotation](examples/video_annotation)
## How to develop
```bash
git clone https://github.com/wkentaro/labelme.git
cd labelme
# Install anaconda3 and labelme
curl -L https://github.com/wkentaro/dotfiles/raw/main/local/bin/install_anaconda3.sh | bash -s .
source .anaconda3/bin/activate
pip install -e .
```
### How to build standalone executable
Below shows how to build the standalone executable on macOS, Linux and Windows.
```bash
# Setup conda
conda create --name labelme python=3.9
conda activate labelme
# Build the standalone executable
pip install .
pip install 'matplotlib<3.3'
pip install pyinstaller
pyinstaller labelme.spec
dist/labelme --version
```
### How to contribute
Make sure below test passes on your environment.
See `.github/workflows/ci.yml` for more detail.
```bash
pip install -r requirements-dev.txt
ruff format --check # `ruff format` to auto-fix
ruff check # `ruff check --fix` to auto-fix
MPLBACKEND='agg' pytest -vsx tests/
```
## Acknowledgement
This repo is the fork of [mpitid/pylabelme](https://github.com/mpitid/pylabelme).
labelme-5.4.1/examples/ 0000775 0000000 0000000 00000000000 14546257460 0014755 5 ustar 00root root 0000000 0000000 labelme-5.4.1/examples/bbox_detection/ 0000775 0000000 0000000 00000000000 14546257460 0017745 5 ustar 00root root 0000000 0000000 labelme-5.4.1/examples/bbox_detection/.readme/ 0000775 0000000 0000000 00000000000 14546257460 0021260 5 ustar 00root root 0000000 0000000 labelme-5.4.1/examples/bbox_detection/.readme/annotation.jpg 0000664 0000000 0000000 00004154265 14546257460 0024155 0 ustar 00root root 0000000 0000000 JFIF Exif MM * J R( i Z e o e o
8Photoshop 3.0 8BIM 8BIM% ُ B~
ICC_PROFILE
appl mntrRGB XYZ
9 +acspAPPL APPL -appl desc P bdscm cprt #wtpt rXYZ gXYZ bXYZ rTRC aarg vcgt @ 0ndin p >chad ,mmod (bTRC gTRC aabg aagg desc Display mluc &