upload-images-to-minio #2
@@ -13,8 +13,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
LABEL_STUDIO_API_TOKEN: ${{ secrets.LABEL_STUDIO_API_TOKEN }}
|
LABEL_STUDIO_API_TOKEN: ${{ secrets.LABEL_STUDIO_API_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
# Replace <your_label_studio_url> and <your_storage_id> with your actual values.
|
|
||||||
# The storage_id can be found in the URL when you view your cloud storage in Label Studio.
|
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Authorization: Token $LABEL_STUDIO_API_TOKEN" \
|
-H "Authorization: Token $LABEL_STUDIO_API_TOKEN" \
|
||||||
"https://label-studio.gt-proj.com/api/storages/export/s3/1/sync"
|
"https://label-studio.gt-proj.com/api/storages/export/s3/1/sync"
|
||||||
|
|
||||||
|
- name: Fix MinIO file content type
|
||||||
|
env:
|
||||||
|
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||||
|
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
||||||
|
run: |
|
||||||
|
mc alias set myminio http://10.0.0.2:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
|
||||||
|
mc mirror --recursive --overwrite --attr 'Content-Type=application/json' \
|
||||||
|
myminio/visual-semiotic-ai-analysis/label-studio-output \
|
||||||
|
myminio/visual-semiotic-ai-analysis/label-studio-output
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class AnnotationRepository(MinioAdapter, AnnotationRepositoryInterface):
|
|||||||
|
|
||||||
encoding: str = "utf-8"
|
encoding: str = "utf-8"
|
||||||
data_format: str = "json"
|
data_format: str = "json"
|
||||||
|
content_type: str = "application/json"
|
||||||
folder_name: str = "annotations"
|
folder_name: str = "annotations"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -81,7 +82,7 @@ class AnnotationRepository(MinioAdapter, AnnotationRepositoryInterface):
|
|||||||
buffer = BytesIO(data_bytes)
|
buffer = BytesIO(data_bytes)
|
||||||
# Put object
|
# Put object
|
||||||
object_name = self._object_name(job_id)
|
object_name = self._object_name(job_id)
|
||||||
self._put(object_name, buffer)
|
self._put(object_name, buffer, self.content_type)
|
||||||
|
|
||||||
def delete(self, job_id: UUID) -> None:
|
def delete(self, job_id: UUID) -> None:
|
||||||
"""Delete an Annotation by its job ID."""
|
"""Delete an Annotation by its job ID."""
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class ImageRepository(MinioAdapter, ImageRepositoryInterface):
|
|||||||
"""ImageRepository implementation using MinIO as the backend."""
|
"""ImageRepository implementation using MinIO as the backend."""
|
||||||
|
|
||||||
image_format: str = "PNG"
|
image_format: str = "PNG"
|
||||||
|
content_type: str = "image/png"
|
||||||
folder_name: str = "images"
|
folder_name: str = "images"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -57,7 +58,7 @@ class ImageRepository(MinioAdapter, ImageRepositoryInterface):
|
|||||||
image.save(buffer, self.image_format)
|
image.save(buffer, self.image_format)
|
||||||
# Put object
|
# Put object
|
||||||
object_name = self._object_name(image_id)
|
object_name = self._object_name(image_id)
|
||||||
self._put(object_name, buffer)
|
self._put(object_name, buffer, self.content_type)
|
||||||
|
|
||||||
def delete(self, image_id: UUID) -> None:
|
def delete(self, image_id: UUID) -> None:
|
||||||
"""Delete an Image by its ID."""
|
"""Delete an Image by its ID."""
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "authlib"
|
name = "authlib"
|
||||||
version = "1.6.3"
|
version = "1.6.4"
|
||||||
source = { registry = "http://10.0.0.2:5001/index/" }
|
source = { registry = "http://10.0.0.2:5001/index/" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "cryptography" },
|
{ name = "cryptography" },
|
||||||
]
|
]
|
||||||
sdist = { url = "http://10.0.0.2:5001/index/authlib/authlib-1.6.3.tar.gz", hash = "sha256:9f7a982cc395de719e4c2215c5707e7ea690ecf84f1ab126f28c053f4219e610" }
|
sdist = { url = "http://10.0.0.2:5001/index/authlib/authlib-1.6.4.tar.gz", hash = "sha256:104b0442a43061dc8bc23b133d1d06a2b0a9c2e3e33f34c4338929e816287649" }
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "http://10.0.0.2:5001/index/authlib/authlib-1.6.3-py2.py3-none-any.whl", hash = "sha256:7ea0f082edd95a03b7b72edac65ec7f8f68d703017d7e37573aee4fc603f2a48" },
|
{ url = "http://10.0.0.2:5001/index/authlib/authlib-1.6.4-py2.py3-none-any.whl", hash = "sha256:39313d2a2caac3ecf6d8f95fbebdfd30ae6ea6ae6a6db794d976405fdd9aa796" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -946,15 +946,15 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-repositories"
|
name = "python-repositories"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
source = { registry = "https://gitea.gt-proj.com/api/packages/brian/pypi/simple/" }
|
source = { registry = "https://gitea.gt-proj.com/api/packages/brian/pypi/simple/" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "python-utils" },
|
{ name = "python-utils" },
|
||||||
{ name = "structlog" },
|
{ name = "structlog" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://gitea.gt-proj.com/api/packages/brian/pypi/files/python-repositories/0.2.2/python_repositories-0.2.2.tar.gz", hash = "sha256:81d690ca632366f24c2cdf7d550d087810ebc6d305be5bc3e0fad6dacfd9acfe" }
|
sdist = { url = "https://gitea.gt-proj.com/api/packages/brian/pypi/files/python-repositories/0.2.3/python_repositories-0.2.3.tar.gz", hash = "sha256:216d1f7cd14ff690c5e6af502a05c7a5de8bfb3202eabf25aa9dbce83b0f384d" }
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://gitea.gt-proj.com/api/packages/brian/pypi/files/python-repositories/0.2.2/python_repositories-0.2.2-py3-none-any.whl", hash = "sha256:3d521b31a9ba21e2113f8ab4b24449ba6767a60c9c22cf75c29a9eb198fc250a" },
|
{ url = "https://gitea.gt-proj.com/api/packages/brian/pypi/files/python-repositories/0.2.3/python_repositories-0.2.3-py3-none-any.whl", hash = "sha256:aa2ef4702f341b89cd973e6e7cfc8a288a5340c67d09ae281285f0a30edec96e" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.optional-dependencies]
|
[package.optional-dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user