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
239066cb
Verified
Commit
239066cb
authored
10 months ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
Fix classification listing
parent
a0f9a8e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!25
Draft: Refactor and implement API version of the worker
Pipeline
#171884
passed
10 months ago
Stage: test
Stage: build
Stage: release
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
worker_generic_training_dataset/__init__.py
+3
-3
3 additions, 3 deletions
worker_generic_training_dataset/__init__.py
worker_generic_training_dataset/from_api.py
+11
-1
11 additions, 1 deletion
worker_generic_training_dataset/from_api.py
with
14 additions
and
4 deletions
worker_generic_training_dataset/__init__.py
+
3
−
3
View file @
239066cb
...
...
@@ -156,14 +156,14 @@ class Extractor(DatasetWorker):
"""
logger
.
info
(
f
"
Processing element (
{
element
}
)
"
)
polygon
=
element
.
polygon
if
isinstance
(
element
,
Element
):
image
=
element
.
image
polygon
=
element
.
polygon
wk_version
=
get_object_id
(
element
.
worker_version
)
wk_run
=
get_object_id
(
element
.
worker_run
)
else
:
image
=
element
.
zone
.
image
polygon
=
element
.
zone
.
polygon
wk_version
=
(
element
.
worker_version
if
hasattr
(
element
,
"
worker_version
"
)
...
...
@@ -229,7 +229,7 @@ class Extractor(DatasetWorker):
f
"
Linking element
{
cached_element
.
id
}
to dataset (
{
self
.
cached_dataset
.
id
}
)
"
)
with
cache_database
.
atomic
():
cached_element
:
CachedDatasetElement
=
CachedDatasetElement
.
create
(
CachedDatasetElement
.
create
(
id
=
uuid
.
uuid4
(),
element
=
cached_element
,
dataset
=
self
.
cached_dataset
,
...
...
This diff is collapsed.
Click to expand it.
worker_generic_training_dataset/from_api.py
+
11
−
1
View file @
239066cb
...
...
@@ -8,7 +8,7 @@ from arkindex_worker.cache import (
CachedTranscription
,
CachedTranscriptionEntity
,
)
from
arkindex_worker.models
import
Element
,
Transcription
from
arkindex_worker.models
import
Element
,
Set
,
Transcription
from
arkindex_worker.worker.classification
import
ClassificationMixin
from
arkindex_worker.worker.element
import
ElementMixin
from
arkindex_worker.worker.entity
import
EntityMixin
...
...
@@ -26,6 +26,16 @@ class DatasetExtractorFromAPI(
TranscriptionMixin
,
MetaDataMixin
,
):
def
list_set_elements
(
self
,
dataset_set
:
Set
)
->
Iterator
[
Element
]:
for
element
in
super
().
list_set_elements
(
dataset_set
):
# Classifications are not serialized in ListDatasetElements
yield
Element
(
**
self
.
request
(
"
RetrieveElement
"
,
id
=
element
.
id
,
)
)
def
list_element_children
(
self
,
*
args
,
**
kwargs
)
->
Iterator
[
Element
]:
return
map
(
Element
,
super
().
list_element_children
(
*
args
,
**
kwargs
,
with_classes
=
True
)
...
...
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