Skip to content

Commit 3cbb38d

Browse files
zhiltsov-maxMarishka17ivhusDzeranov
authored
[CVAT-M2] Updates for the annotation experiment (humanprotocol#1780)
* Fix job event handling when no assignments exist * Implement boxes from points task creation * Refactor cloud storage api * Implement job downloading * Estimate max bbox * Little refactoring * Copy some shared code from excor to recor * Refactor task creation and export * Implement boxes from points validation * Integrate SDK updates * Fix escrow access * [Exchange/Recoring oracles] Add GCS support * Remove local dev mocks * Remove some extra changes * Update tests * Update some tests * Remove extra launcher change * Refactor code * Add google-cloud-storage dependency * Fix exception classes * Set env variables in docker-compose.test.yml * [CVAT] Points to boxes task (humanprotocol#1560) * Fix job event handling when no assignments exist * Implement boxes from points task creation * Refactor cloud storage api * Implement job downloading * Estimate max bbox * Little refactoring * Copy some shared code from excor to recor * Refactor task creation and export * Implement boxes from points validation * Integrate SDK updates * Fix escrow access * Remove local dev mocks * Remove some extra changes * Update tests * Update some tests * Remove extra launcher change * Use virtual hosted bucket style * Fix creating CS in CVAT * Fix tests * Add basic implementation for skeletons from boxes * Refactor and fix some errors * Implement job uploading * Implement downloading * Fix extra gt boxes in merged results from excor * Implement skeleton matching * Fix labels in merged annotations * Update project events handling in excor * Improve oks sigma comment * Remove local testing assets * Fix label mapping * Add extra skeleton validations in manifest * Update .env template * Update several comments * Fix failing tests * Update enum name * Add more annotation validations for skeletons * Extend input annotations validation * Fix quality computation, refactor * Unify assignment accuracy checks between different job types * Refactor GT downloading for validation * Add gcs support - fixes (#1) * Update code formatting * Update poetry lock * Refactor * Use dict for gcs file contents * Update class name * Add backward compatibility for data bucket env var * Remove extra changes * Remove extra import * Fix enum name * Update bucket access info parsing * Fix error type in cloud provider parsing * Update tests * Add job annotation mode param into assignment links * Add CD trigger for experimental cvat oracles * Update code formatting * Fix test * Format code * Fix bucket uses * Fix result sending * Remove extra changes * Fix extra code * Remove unused code * Align enum naming convention * Use relative paths in bucket in task creation * Improve error messages * Improve skeleton and bbox validation * Fix escrow manifest downloading * Update tests * Fix tests * Implement general image bans * Fix import * Make default gt ban threshold more strict * Fix comparison for absent points * Fix comparison for omitted points in jobs * Finish escrows with too many unverifiable assignments * Check if an increased healthcheck interval will fix unhealthy container (humanprotocol#1700) * Fix validations for boxes from points task creation * Clean code * disable roi estimation for unreliable cases * Fix manifest parsing * Remove m0 launcher stubs * Remove m0 rep or stubs * Make max assignment time optional in manifest * Make label type fully optional in manifest * Fix test * Enable and fix a disabled m1 task creation test * Don't fail on too many unused GT in boxes from points * Make joints optional in skeletons from boxes manifests * Review gt exclusion errors * Fix RecOr tests --------- Co-authored-by: maya <[email protected]> Co-authored-by: Ivan <[email protected]> Co-authored-by: Dzeranov <[email protected]>
1 parent 980bde7 commit 3cbb38d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/examples/cvat/exchange-oracle/src/core/manifest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class SkeletonLabelInfo(LabelInfoBase):
7676
]
7777
"""
7878

79-
joints: List[Tuple[int, int]]
79+
joints: Optional[List[Tuple[int, int]]] = Field(default_factory=list)
8080
"A list of node adjacency, e.g. [[0, 1], [1, 2], [1, 3]]"
8181

8282
@root_validator

packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def _validate_gt_annotations(self):
352352

353353
if (
354354
excluded_gt_info.excluded_count
355-
> excluded_gt_info.total_count * self.max_discarded_threshold
355+
> ceil(excluded_gt_info.total_count * self.max_discarded_threshold)
356356
):
357357
raise TooFewSamples(
358358
"Too many GT boxes discarded, canceling job creation. Errors: {}".format(
@@ -512,7 +512,7 @@ def _validate_skeleton(skeleton: dm.Skeleton, *, sample_bbox: dm.Bbox):
512512

513513
if (
514514
excluded_points_info.excluded_count
515-
> excluded_points_info.total_count * self.max_discarded_threshold
515+
> ceil(excluded_points_info.total_count * self.max_discarded_threshold)
516516
):
517517
raise TooFewSamples(
518518
"Too many points discarded, canceling job creation. Errors: {}".format(
@@ -614,7 +614,7 @@ def _prepare_gt(self):
614614
sample_id=gt_sample.id,
615615
sample_subset=gt_sample.subset,
616616
)
617-
excluded_gt_info.excluded_count += 1
617+
# Don't need to count as excluded, because it's not an error in annotations
618618
continue
619619
elif len(matched_skeletons) == 0:
620620
# Handle unmatched boxes
@@ -650,7 +650,7 @@ def _prepare_gt(self):
650650

651651
if (
652652
excluded_gt_info.excluded_count
653-
> excluded_gt_info.total_count * self.max_discarded_threshold
653+
> ceil(excluded_gt_info.total_count * self.max_discarded_threshold)
654654
):
655655
raise DatasetValidationError(
656656
"Too many GT boxes discarded ({} out of {}). "
@@ -1327,7 +1327,7 @@ def _validate_skeleton(skeleton: dm.Skeleton, *, sample_bbox: dm.Bbox):
13271327

13281328
if (
13291329
excluded_gt_info.excluded_count
1330-
> excluded_gt_info.total_count * self.max_discarded_threshold
1330+
> ceil(excluded_gt_info.total_count * self.max_discarded_threshold)
13311331
):
13321332
raise TooFewSamples(
13331333
"Too many GT skeletons discarded, canceling job creation. Errors: {}".format(
@@ -1430,7 +1430,7 @@ def _validate_boxes_annotations(self):
14301430

14311431
if (
14321432
excluded_boxes_info.excluded_count
1433-
> excluded_boxes_info.total_count * self.max_discarded_threshold
1433+
> ceil(excluded_boxes_info.total_count * self.max_discarded_threshold)
14341434
):
14351435
raise TooFewSamples(
14361436
"Too many boxes discarded, canceling job creation. Errors: {}".format(
@@ -1580,7 +1580,7 @@ def _prepare_gt(self):
15801580
sample_id=gt_sample.id,
15811581
sample_subset=gt_sample.subset,
15821582
)
1583-
excluded_gt_info.excluded_count += 1
1583+
# Don't need to count as excluded, because it's not an error in annotations
15841584
continue
15851585
elif len(matched_boxes) == 0:
15861586
# Handle unmatched boxes
@@ -1620,8 +1620,8 @@ def _prepare_gt(self):
16201620
)
16211621

16221622
if (
1623-
len(skeleton_bbox_mapping)
1624-
< (1 - self.max_discarded_threshold) * excluded_gt_info.total_count
1623+
excluded_gt_info.excluded_count
1624+
> ceil(self.max_discarded_threshold * excluded_gt_info.total_count)
16251625
):
16261626
raise DatasetValidationError(
16271627
"Too many GT skeletons discarded ({} out of {}). "

packages/examples/cvat/recording-oracle/src/core/manifest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class SkeletonLabelInfo(LabelInfoBase):
7676
]
7777
"""
7878

79-
joints: List[Tuple[int, int]]
79+
joints: Optional[List[Tuple[int, int]]] = Field(default_factory=list)
8080
"A list of node adjacency, e.g. [[0, 1], [1, 2], [1, 3]]"
8181

8282
@root_validator

0 commit comments

Comments
 (0)