Compare commits
No commits in common. "main" and "v0.1.6" have entirely different histories.
|
@ -1,39 +0,0 @@
|
||||||
# This workflow will upload a Python Package using Twine when a release is created
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
||||||
|
|
||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
|
|
||||||
name: Upload Python Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install build
|
|
||||||
- name: Build package
|
|
||||||
run: python -m build
|
|
||||||
- name: Publish package
|
|
||||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
|
||||||
with:
|
|
||||||
user: __token__
|
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
[](https://pypi.org/project/labelme2yolo)
|
[](https://pypi.org/project/labelme2yolo)
|
||||||

|

|
||||||
[](https://pepy.tech/project/labelme2yolo)
|
|
||||||
[](https://pypi.org/project/labelme2yolo)
|
[](https://pypi.org/project/labelme2yolo)
|
||||||
[](https://www.codacy.com/gh/GreatV/labelme2yolo/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=GreatV/labelme2yolo\&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/gh/GreatV/labelme2yolo/dashboard?utm_source=github.com\&utm_medium=referral\&utm_content=GreatV/labelme2yolo\&utm_campaign=Badge_Grade)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ classifiers = [
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"opencv-python>=4.1.2",
|
"opencv-python>=4.1.2",
|
||||||
"Pillow>=9.2,<10.4",
|
"Pillow>=9.2,<10.3",
|
||||||
"numpy>=1.23.1,<1.27.0",
|
"numpy>=1.23.1,<1.27.0",
|
||||||
"rich"
|
"rich"
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
"""
|
"""
|
||||||
about version
|
about version
|
||||||
"""
|
"""
|
||||||
__version__ = "0.1.7"
|
__version__ = "0.1.6"
|
||||||
|
|
|
@ -137,14 +137,14 @@ def save_yolo_image(json_data, json_dir, image_dir, target_dir, target_name):
|
||||||
"""Save yolo image to image_dir_path/target_dir"""
|
"""Save yolo image to image_dir_path/target_dir"""
|
||||||
img_path = os.path.join(image_dir, target_dir, target_name)
|
img_path = os.path.join(image_dir, target_dir, target_name)
|
||||||
|
|
||||||
if json_data["imageData"]:
|
if json_data["imageData"] is None:
|
||||||
img = img_b64_to_arr(json_data["imageData"])
|
|
||||||
PIL.Image.fromarray(img).save(img_path)
|
|
||||||
else:
|
|
||||||
image_name = json_data["imagePath"]
|
image_name = json_data["imagePath"]
|
||||||
src_image_name = os.path.join(json_dir, image_name)
|
src_image_name = os.path.join(json_dir, image_name)
|
||||||
src_image = cv2.imread(src_image_name)
|
src_image = cv2.imread(src_image_name)
|
||||||
cv2.imwrite(img_path, src_image)
|
cv2.imwrite(img_path, src_image)
|
||||||
|
else:
|
||||||
|
img = img_b64_to_arr(json_data["imageData"])
|
||||||
|
PIL.Image.fromarray(img).save(img_path)
|
||||||
|
|
||||||
return img_path
|
return img_path
|
||||||
|
|
||||||
|
@ -166,7 +166,6 @@ class Labelme2YOLO:
|
||||||
label: label_id for label_id, label in enumerate(label_list)
|
label: label_id for label_id, label in enumerate(label_list)
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
logger.info("Searching label list from json files ...")
|
|
||||||
# get label list from json files for parallel processing
|
# get label list from json files for parallel processing
|
||||||
json_files = glob.glob(
|
json_files = glob.glob(
|
||||||
os.path.join(self._json_dir, "**", "*.json"), recursive=True
|
os.path.join(self._json_dir, "**", "*.json"), recursive=True
|
||||||
|
|
Loading…
Reference in New Issue