Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Generic Training Dataset
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Workers
Generic Training Dataset
Commits
02222044
Verified
Commit
02222044
authored
1 year ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
use new rc
parent
48f686bf
No related branches found
No related tags found
1 merge request
!2
Implement worker
Pipeline
#81803
passed
1 year ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
worker_generic_training_dataset/utils.py
+0
-9
0 additions, 9 deletions
worker_generic_training_dataset/utils.py
worker_generic_training_dataset/worker.py
+4
-5
4 additions, 5 deletions
worker_generic_training_dataset/worker.py
with
4 additions
and
14 deletions
worker_generic_training_dataset/utils.py
+
0
−
9
View file @
02222044
...
@@ -7,7 +7,6 @@ from urllib.parse import urljoin
...
@@ -7,7 +7,6 @@ from urllib.parse import urljoin
import
cv2
import
cv2
import
imageio.v2
as
iio
import
imageio.v2
as
iio
from
arkindex_worker.utils
import
close_delete_file
,
create_tar_archive
,
zstd_compress
from
worker_generic_training_dataset.exceptions
import
ImageDownloadError
from
worker_generic_training_dataset.exceptions
import
ImageDownloadError
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -53,11 +52,3 @@ def download_image(element, folder: Path):
...
@@ -53,11 +52,3 @@ def download_image(element, folder: Path):
tries
+=
1
tries
+=
1
except
Exception
as
e
:
except
Exception
as
e
:
raise
ImageDownloadError
(
element
.
id
,
e
)
raise
ImageDownloadError
(
element
.
id
,
e
)
def
create_tar_zstd_archive
(
folder_path
,
destination
:
Path
):
tar_fd
,
tar_archive
,
_
=
create_tar_archive
(
folder_path
)
_
,
_
,
_
=
zstd_compress
(
tar_archive
,
destination
)
close_delete_file
(
tar_fd
,
tar_archive
)
This diff is collapsed.
Click to expand it.
worker_generic_training_dataset/worker.py
+
4
−
5
View file @
02222044
...
@@ -21,6 +21,7 @@ from arkindex_worker.cache import (
...
@@ -21,6 +21,7 @@ from arkindex_worker.cache import (
)
)
from
arkindex_worker.cache
import
db
as
cache_database
from
arkindex_worker.cache
import
db
as
cache_database
from
arkindex_worker.cache
import
init_cache_db
from
arkindex_worker.cache
import
init_cache_db
from
arkindex_worker.utils
import
create_tar_zst_archive
from
arkindex_worker.worker.base
import
BaseWorker
from
arkindex_worker.worker.base
import
BaseWorker
from
worker_generic_training_dataset.db
import
(
from
worker_generic_training_dataset.db
import
(
get_children
,
get_children
,
...
@@ -29,10 +30,7 @@ from worker_generic_training_dataset.db import (
...
@@ -29,10 +30,7 @@ from worker_generic_training_dataset.db import (
retrieve_element
,
retrieve_element
,
retrieve_entities
,
retrieve_entities
,
)
)
from
worker_generic_training_dataset.utils
import
(
from
worker_generic_training_dataset.utils
import
download_image
create_tar_zstd_archive
,
download_image
,
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -278,7 +276,8 @@ class DatasetExtractor(BaseWorker):
...
@@ -278,7 +276,8 @@ class DatasetExtractor(BaseWorker):
# TAR + ZSTD Image folder and store as task artifact
# TAR + ZSTD Image folder and store as task artifact
zstd_archive_path
=
self
.
work_dir
/
"
arkindex_data.zstd
"
zstd_archive_path
=
self
.
work_dir
/
"
arkindex_data.zstd
"
logger
.
info
(
f
"
Compressing the images to
{
zstd_archive_path
}
"
)
logger
.
info
(
f
"
Compressing the images to
{
zstd_archive_path
}
"
)
create_tar_zstd_archive
(
folder_path
=
image_folder
,
destination
=
zstd_archive_path
)
create_tar_zst_archive
(
source
=
image_folder
,
destination
=
zstd_archive_path
)
# Cleanup image folder
# Cleanup image folder
shutil
.
rmtree
(
image_folder
)
shutil
.
rmtree
(
image_folder
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment