Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC'24] Merge consensus jobs #8042

Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
f1cf973
Merge branch 'cvat-ai:develop' into merge_consensus_jobs
Viditagarwal7479 Jun 10, 2024
3c347e8
Merge branch 'consensus-job' of https://github.com/Viditagarwal7479/c…
Viditagarwal7479 Jun 12, 2024
67b3d00
created consensus app for handling merging
Viditagarwal7479 Jun 18, 2024
afe5332
created agreegate endpoint, to agreegate consensus jobs in the task
Viditagarwal7479 Jun 18, 2024
fcf99ff
added Python RQ for consensus app
Viditagarwal7479 Jun 18, 2024
9ae06c3
added mergeConsensusJobs function to Task session in the frontend, wh…
Viditagarwal7479 Jun 18, 2024
4a11184
added merging task actions in the frontend
Viditagarwal7479 Jun 18, 2024
0375a32
Merge branch 'cvat-ai:develop' into merge_consensus_jobs
Viditagarwal7479 Jun 18, 2024
d44ffdc
made agreegate request method to PUT instead of GET
Viditagarwal7479 Jun 18, 2024
a65d819
added notification message when agreegation is succeded or failed
Viditagarwal7479 Jun 18, 2024
ee7c466
fixed spelling of aggregate
Viditagarwal7479 Jun 19, 2024
e5fcf92
added transaction.atomic decorator to _merge_consensus_jobs function …
Viditagarwal7479 Jun 19, 2024
f02175c
Merge branch 'consensus-job' into merge_consensus_jobs
Viditagarwal7479 Jun 19, 2024
83a2866
added datumaro's default IntersectMerge implementation
Viditagarwal7479 Jun 20, 2024
91cdb47
Merge branch 'consensus-job' of https://github.com/Viditagarwal7479/c…
Viditagarwal7479 Jun 22, 2024
7b631c2
renamed `consensusJobPerSegment` to `consensusJobsPerSegment`
Viditagarwal7479 Jun 30, 2024
e20398e
added consensus settings to the backend and connected UI in the front…
Viditagarwal7479 Jul 2, 2024
8ea9f01
Merge branch 'consensus-job' of https://github.com/Viditagarwal7479/c…
Viditagarwal7479 Jul 2, 2024
821c1f5
Merge branch 'consensus-job' of https://github.com/Viditagarwal7479/c…
Viditagarwal7479 Jul 3, 2024
d38635c
removed unwanted `console.log`
Viditagarwal7479 Jul 3, 2024
384787d
`Save` and `Reset Settings` Button are centred in the consensus confi…
Viditagarwal7479 Jul 3, 2024
a67b0e7
Colour of `Merge Consensus Task` button is now more coherrent with re…
Viditagarwal7479 Jul 3, 2024
3b4ec80
added typed annotation in functions for `merge_consensus_jobs.py`
Viditagarwal7479 Jul 4, 2024
a67a83a
made used the JobType parameter to make the mapping of parent_job to …
Viditagarwal7479 Jul 4, 2024
5d71b41
converted documentation type comment block to normal comment block
Viditagarwal7479 Jul 4, 2024
6012bd2
removed the return status codes in function `_merge_consensus_jobs`
Viditagarwal7479 Jul 4, 2024
8bd8f01
added `cvat/apps/consensus` to `format_python_code.sh`
Viditagarwal7479 Jul 4, 2024
fd90a2a
setting `consensus_settings` default value same as that of CLI merge …
Viditagarwal7479 Jul 4, 2024
b24e080
added pyproject.toml for black formating
Viditagarwal7479 Jul 5, 2024
8db74e6
added `consensus_reports` and `consensus_conflict` in the backend thu…
Viditagarwal7479 Jul 5, 2024
e538038
updated `schema.yml`
Viditagarwal7479 Jul 5, 2024
2f7438a
merged new multiple django app migrations into single migration
Viditagarwal7479 Jul 7, 2024
6dda769
Merge branch 'consensus-job' into merge_consensus_jobs
Viditagarwal7479 Jul 8, 2024
8502b0a
fixed `schema.yml` conflicts after merging `consensus-job` branch
Viditagarwal7479 Jul 8, 2024
1bf9420
fixed migration files after merging `consensus-job` branch
Viditagarwal7479 Jul 8, 2024
c986c80
made endpoint `task/{id}/aggregate` functional even after adding new …
Viditagarwal7479 Jul 8, 2024
d7aed9d
Added the case of an annotated job might have no annotations
Viditagarwal7479 Jul 8, 2024
4b55035
changed `consensusJobPerSegment` to `consensusJobPerNormalJob`
Viditagarwal7479 Jul 8, 2024
e988def
improved the colour of buttons under consensus config action
Viditagarwal7479 Jul 8, 2024
f5cf75a
set the default of `quorum` to floor half of `consensus jobs`
Viditagarwal7479 Jul 9, 2024
ea1f3cd
mentioned the type of task object in a function
Viditagarwal7479 Jul 9, 2024
283578f
fixed SaasError of rule order `@use` and `@import`
Viditagarwal7479 Jul 9, 2024
bf8fa7d
improved english on UI
Viditagarwal7479 Jul 9, 2024
2da336f
removed `parent` param from conflict which isn't presnt in `Consensus…
Viditagarwal7479 Jul 12, 2024
df460ce
removed consensus config block and moved `consensus_job_per_normal_jo…
Viditagarwal7479 Jul 12, 2024
a81f057
Merge branch 'consensus-job' of https://github.com/Viditagarwal7479/c…
Viditagarwal7479 Jul 12, 2024
2a07da7
while merging only consider `normal job` if it's in `annotation` stage
Viditagarwal7479 Jul 13, 2024
d8955f2
after merging annotation change normal job `state` to `in_progress` a…
Viditagarwal7479 Jul 13, 2024
32190e2
removed notifcation when saving consensus settings and added a loadin…
Viditagarwal7479 Jul 13, 2024
b9a8b19
added confirmation box when reseting consensus settings
Viditagarwal7479 Jul 13, 2024
10e1053
when consensus jobs are merged the parent job goes in `NEW` state
Viditagarwal7479 Jul 18, 2024
e467eb3
gave everyone assigned to that Task permission to view the Consensus …
Viditagarwal7479 Jul 18, 2024
8508e2e
changed the term `normal job` to `regular job`
Viditagarwal7479 Jul 18, 2024
c24a82d
shifted the consensus based annotation tag below the details of task
Viditagarwal7479 Jul 18, 2024
3b90c8f
Merge branch 'consensus-job' of https://github.com/Viditagarwal7479/c…
Viditagarwal7479 Jul 18, 2024
a5224f1
changed the some leftover usage of `normal job` to `regular job`
Viditagarwal7479 Jul 18, 2024
27297f4
after merging consensus jobs regular job's state is marked as COMPLETE
Viditagarwal7479 Jul 18, 2024
e33f9b2
changed button name for mergeing consensus jobs
Viditagarwal7479 Jul 18, 2024
4bf0aeb
Merge branch 'gsoc/consensus-feature' of https://github.com/opencv/cv…
Viditagarwal7479 Jul 26, 2024
033b6a8
added missing `,` in `TaskReadSerializer` fields
Viditagarwal7479 Jul 27, 2024
6d49bf5
added the max. 10 consensus jobs per regular job condition
Viditagarwal7479 Jul 27, 2024
2c906bb
added tests related to setting consensus jobs per regular job
Viditagarwal7479 Jul 27, 2024
7635f34
fixed OKS implementation
Viditagarwal7479 Jul 28, 2024
a6a9def
Merge branch 'develop' of https://github.com/opencv/cvat into merge_c…
Viditagarwal7479 Jul 28, 2024
1b206a3
added sigma for OKS calculation in consensus settings
Viditagarwal7479 Jul 28, 2024
1e60737
added matching from `quality_reports.py` and merging of skeletons to …
Viditagarwal7479 Jul 28, 2024
6c24859
formatted python code
Viditagarwal7479 Jul 28, 2024
0412835
added consensus jobs and their annotations into backup
Viditagarwal7479 Jul 30, 2024
f5a4880
added `restore_db_per_function` to TestTaskBackups
Viditagarwal7479 Jul 30, 2024
89b86df
fixed `JobSummarySerializer` to include all types of Jobs in `TaskSum…
Viditagarwal7479 Aug 3, 2024
2c2ca6a
fixed a typo in project as peoject
Viditagarwal7479 Aug 5, 2024
9315d67
added consensus score and assignee to consensus report
Viditagarwal7479 Aug 5, 2024
7ede7cb
added separate consensus merge and analytics button
Viditagarwal7479 Aug 5, 2024
cc036a4
fixed that `count` param wasn't considering `consensus jobs` in Task …
Viditagarwal7479 Aug 6, 2024
c186d67
removed unwanted comments
Viditagarwal7479 Aug 6, 2024
93d0758
count param in `tasks.json` for testing updated
Viditagarwal7479 Aug 6, 2024
f7c20a0
added target param while filtering consensus report
Viditagarwal7479 Aug 8, 2024
d922b8f
added target and assignee in consensus reports
Viditagarwal7479 Aug 8, 2024
ca4d4f2
added consensus migrations
Viditagarwal7479 Aug 8, 2024
c240ee7
reformatting and removed unused imports
Viditagarwal7479 Aug 8, 2024
0b428f8
updated implementation of count of jobs in task details
Viditagarwal7479 Aug 8, 2024
26a7157
updated shade of yellow color in quality and consensus color
Viditagarwal7479 Aug 8, 2024
2af30ba
renamed QualityConflictsFilter to ConflictsFilter
Viditagarwal7479 Aug 8, 2024
13e9edb
added interface for Consensus Reports, Settings and Conflict
Viditagarwal7479 Aug 8, 2024
8170c8a
replace `jobName` change with a Tag
Viditagarwal7479 Aug 8, 2024
3eb8ec6
updated `schema.yml`
Viditagarwal7479 Aug 8, 2024
924ad45
added tag to consensus job list in task view
Viditagarwal7479 Aug 8, 2024
91caee6
removed settings reset button
Viditagarwal7479 Aug 8, 2024
a487dd0
confirmation dialog before merging consensus jobs
Viditagarwal7479 Aug 8, 2024
59f2daa
added structure of consensus conflict and report
Viditagarwal7479 Aug 8, 2024
79c2a7b
added consensus analytics page
Viditagarwal7479 Aug 8, 2024
008d14b
removed declaration of unused variable in consensus test case
Viditagarwal7479 Aug 8, 2024
e6c7f58
reformat consensus settings form
Viditagarwal7479 Aug 8, 2024
d9466bf
Merge branch 'gsoc/consensus-feature' into merge_consensus_jobs
Viditagarwal7479 Aug 8, 2024
7c0aefc
added `AssigneeConsensusReport`
Viditagarwal7479 Aug 12, 2024
54e7d97
formatted python files
Viditagarwal7479 Aug 12, 2024
fdfc3cb
added `assignee consensus report` in the react for assignee consensus…
Viditagarwal7479 Aug 12, 2024
de1e7eb
added assignee consnesus report into assignee list
Viditagarwal7479 Aug 12, 2024
06bea50
removed console.log and fixed sort statement in table
Viditagarwal7479 Aug 12, 2024
5e0bc21
removed consensus modal
Viditagarwal7479 Aug 12, 2024
11258ec
added more appropriate type and assert to common `segment_iou`
Viditagarwal7479 Aug 12, 2024
bb7f242
added check of `media` before accessing it's attributes
Viditagarwal7479 Aug 12, 2024
40585f4
added consensus worker information to yml files
Viditagarwal7479 Aug 13, 2024
4228ad2
removed create assignee report endpoint
Viditagarwal7479 Aug 13, 2024
ced9e5c
updated `schema.yml`
Viditagarwal7479 Aug 13, 2024
9d1fd92
added consensus endpoints for test json dump
Viditagarwal7479 Aug 13, 2024
d2a6789
refined the message in confirmation box before merging consnesus jobs
Viditagarwal7479 Aug 14, 2024
01ef325
added information about conflict count at assignee level
Viditagarwal7479 Aug 14, 2024
ca61c51
disabled merge button when merging in progress
Viditagarwal7479 Aug 14, 2024
755465e
added `cvat-task-analytics-tabs` to `styles.scss`
Viditagarwal7479 Aug 14, 2024
7f229ad
Replaced Analytics with Consensus Analytics
Viditagarwal7479 Aug 14, 2024
fc5b670
removed consensus tab from old analytics page
Viditagarwal7479 Aug 14, 2024
1acb383
removed the stale action types for consensus modal
Viditagarwal7479 Aug 14, 2024
4532b28
moved consensus analytics page from `/tasks/id/analytics/consensus` t…
Viditagarwal7479 Aug 14, 2024
cd05f0f
converted snake_case to camelCase in typescript code
Viditagarwal7479 Aug 14, 2024
3ea3981
removed `styles.scss` associated with earlier `consensus modal`
Viditagarwal7479 Aug 14, 2024
0bac45b
moved `consensus-settings-form` file into the consensus analytics folder
Viditagarwal7479 Aug 14, 2024
76f2d2c
Merge branch 'gsoc/consensus-feature' of https://github.com/Viditagar…
Viditagarwal7479 Aug 14, 2024
d3c3750
removed reference to deleted `styles.scss`
Viditagarwal7479 Aug 14, 2024
188f9f0
updated path of `ConsensusSettingsForm` while refering in code
Viditagarwal7479 Aug 14, 2024
3ce1295
modified consensus migrations based on changes in engine migrations a…
Viditagarwal7479 Aug 14, 2024
2fb5941
Merge branch 'gsoc/consensus-feature' into merge_consensus_jobs
Viditagarwal7479 Aug 14, 2024
145a9d2
Merge commit 'cc036a46a4c54353bf83763903d367829bbd5dd5' into merge_co…
Viditagarwal7479 Aug 14, 2024
2ac3abc
Merge commit '008d14b8beb2a7a5d3fb619881b806042c69c489' into merge_co…
Viditagarwal7479 Aug 14, 2024
a1b2651
changed endpoint from `/analytics/consensus` to `/consensus`
Viditagarwal7479 Aug 14, 2024
99e78d2
removed consensus report created information from UI when it's not cr…
Viditagarwal7479 Aug 14, 2024
b8566a1
Revert "removed consensus report created information from UI when it'…
Viditagarwal7479 Aug 14, 2024
8fab2b4
removed unwanted notification for consensus job error added useful ea…
Viditagarwal7479 Aug 14, 2024
0654857
removed consensus report created date info from UI when it's not created
Viditagarwal7479 Aug 14, 2024
eebc206
removed unwanted notification for consensus job error added useful ea…
Viditagarwal7479 Aug 14, 2024
30c80bd
removed consensus report created date info from UI when it's not created
Viditagarwal7479 Aug 14, 2024
07b9c0b
Merge remote-tracking branch 'origin/merge_consensus_jobs' into merge…
Viditagarwal7479 Aug 14, 2024
8301ad2
set the `conflict_count` before accessing it even if no errors are there
Viditagarwal7479 Aug 15, 2024
0550298
uncommented consensus worker deployment .conf
Viditagarwal7479 Aug 15, 2024
d59568a
renamed `SettingsFilter` to `QualitySettingsFilter` and `ConsensusSet…
Viditagarwal7479 Aug 15, 2024
b079593
increased weight of `MERGE_CONSENSUS_JOBS` action button from 55 to 60
Viditagarwal7479 Aug 15, 2024
5db8cb0
made `_Serializable` public by removing `_`
Viditagarwal7479 Aug 15, 2024
8539683
optimised the consensus jobs fetching process to make fewer database …
Viditagarwal7479 Aug 15, 2024
ff4140f
added support for no assignee in `AssigneeConsensusReport`
Viditagarwal7479 Aug 15, 2024
8e0d4ac
moved setting the default `quorum` where it's created as function cal…
Viditagarwal7479 Aug 15, 2024
6fda20f
assignee in assignee consensus report wouldn't be none
Viditagarwal7479 Aug 15, 2024
7787fe2
replaced `assigneeID` with `assignee.id`
Viditagarwal7479 Aug 15, 2024
0376d31
Merge branch 'develop' of https://github.com/Viditagarwal7479/cvat in…
Viditagarwal7479 Aug 15, 2024
2a2efe9
made the job type tag into ribbon in jobs page
Viditagarwal7479 Aug 15, 2024
b6e21ff
added case for null assignee in `AssigneeConsensusReport`
Viditagarwal7479 Aug 15, 2024
3f8e171
added function to create `assignee_consensus_report`
Viditagarwal7479 Aug 15, 2024
893091a
moved calc. `task_mean_consensus_score` out from `save_report`
Viditagarwal7479 Aug 15, 2024
1c427ed
reformatted file and removed duplicated code
Viditagarwal7479 Aug 15, 2024
6bce0ac
reformatted files
Viditagarwal7479 Aug 15, 2024
0ceed73
fixed assignee consensus report when consensus score is nan (no annot…
Viditagarwal7479 Aug 16, 2024
2336773
fixed issue in consensus helm `deployment.yml` while copying from qua…
Viditagarwal7479 Aug 17, 2024
9c0a545
removed unused python imports
Viditagarwal7479 Aug 17, 2024
aa3dcda
fixed nan issue in consensus score when a frame has no annotations
Viditagarwal7479 Aug 18, 2024
d0659b6
made mask matching work the same as polygon matching
Viditagarwal7479 Aug 18, 2024
1ae7309
`self.errors` should contain errors specifc to the current passed dat…
Viditagarwal7479 Aug 18, 2024
c48223e
consensus analytics page is only for task
Viditagarwal7479 Aug 18, 2024
11ef270
added `get_ann_dataset_id` function instead of using class private ob…
Viditagarwal7479 Aug 18, 2024
5530bb4
inherited common properties of `LineMatcher` from `quality_reports.py`
Viditagarwal7479 Aug 19, 2024
1dc43e4
removed unsed function definition
Viditagarwal7479 Aug 19, 2024
05bd621
added `self` param to function defined inside class
Viditagarwal7479 Aug 19, 2024
9b67b7f
added type info to function `match_annotations_two_sources`
Viditagarwal7479 Aug 19, 2024
26e9ab6
fixed the `dm.PolyLine` instead of `dm.Skeleton` in `LineMatcher`
Viditagarwal7479 Aug 19, 2024
ddff303
added return type info instead of pass in `match_annotations_two_sour…
Viditagarwal7479 Aug 19, 2024
6bccbbc
made private objects of IntersectMerge publicly accessible
Viditagarwal7479 Aug 19, 2024
c0af3ee
(in attrib) made private objects of IntersectMerge publicly accessible
Viditagarwal7479 Aug 19, 2024
bd86446
reused objects from `DistanceComparator` in `quality_reports.py` in `…
Viditagarwal7479 Aug 19, 2024
8c09dcf
redefined private class objects to be used publicly
Viditagarwal7479 Aug 19, 2024
060e518
fixed the output type of `match_annotations_two_sources`
Viditagarwal7479 Aug 19, 2024
0692c6b
used the reference to `dm.ops.segment_iou` as default
Viditagarwal7479 Aug 19, 2024
ec58672
label can't be None after merging
Viditagarwal7479 Aug 19, 2024
03a3c31
Merge-able "if" statements are combined
Viditagarwal7479 Aug 19, 2024
e4cc879
updated the return type of function updated in previous commit
Viditagarwal7479 Aug 19, 2024
789cb74
used `(len(...) or 1)` instead of `np.isnan`
Viditagarwal7479 Aug 19, 2024
25e247e
instead of storing `parent_job_id` storing `parent_job` for the conse…
Viditagarwal7479 Aug 20, 2024
ecb8367
made earlier pvt members of `IntersectMerge` pvt again
Viditagarwal7479 Aug 20, 2024
bc3a4d5
added fixed implementation of inherited functions
Viditagarwal7479 Aug 20, 2024
fa42b98
`match_annotations_two_sources` only returns matches
Viditagarwal7479 Aug 20, 2024
4767f74
formatted python files
Viditagarwal7479 Aug 20, 2024
373ec86
improved caching of distances
Viditagarwal7479 Aug 20, 2024
4b4847a
removed unused import
Viditagarwal7479 Aug 20, 2024
f92c0a2
corrected related name param while querying for parent job
Viditagarwal7479 Aug 21, 2024
039c076
added serialisation of assignee in consensus report
Viditagarwal7479 Aug 22, 2024
47733ac
updated related name in Jobs to `childern_jobs`
Viditagarwal7479 Aug 23, 2024
9353906
made keys symmetric in distance caching
Viditagarwal7479 Aug 25, 2024
d3f1bab
added `line_thickness` param for LineMatcher
Viditagarwal7479 Aug 25, 2024
a2c7fe7
removed `DistanceComparator` inheritance with `_distance_comparator` …
Viditagarwal7479 Aug 25, 2024
d06d124
added accessing private class objects through separate function
Viditagarwal7479 Aug 25, 2024
e544e79
converted `OKS` to `oks`
Viditagarwal7479 Aug 25, 2024
bc6cd9a
reformatted code
Viditagarwal7479 Aug 25, 2024
2f49390
reformatted code
Viditagarwal7479 Aug 25, 2024
a9eb879
created a function to get quality and consensus conflicts, to reduce …
Viditagarwal7479 Aug 27, 2024
de91e88
replaced `Conf` reference in `IntersectMerge` object with `conf` the …
Viditagarwal7479 Aug 27, 2024
8db1d21
Passing annotations as `dm.DatasetItem` into quality_reports `match_s…
Viditagarwal7479 Aug 27, 2024
f666c57
added `line_thickness` in consensus settings
Viditagarwal7479 Aug 27, 2024
145fd7a
corrected typed annotation in python function
Viditagarwal7479 Aug 27, 2024
3d68358
reused code from quality_report and used the symmetric property of ca…
Viditagarwal7479 Aug 27, 2024
46a5003
moved `rq_id` into query params
Viditagarwal7479 Aug 27, 2024
ba1d875
reused the `issues.tsx` from task-quality in consensus
Viditagarwal7479 Aug 27, 2024
b68f761
added `rq_id` to consensus jobs merging to handle `rq_id` for consens…
Viditagarwal7479 Aug 28, 2024
3b158b0
used the common sorter implementation in `job_list.tsx` in `task-qual…
Viditagarwal7479 Aug 28, 2024
795daad
`if` to `else if`
Viditagarwal7479 Aug 28, 2024
0ab57db
added `line_thickness` in consensus reports
Viditagarwal7479 Aug 29, 2024
11c9798
added parent job wise merging in task with consensus jobs
Viditagarwal7479 Aug 29, 2024
4a0d988
`task_id` of a job can't be `null` typescript model
Viditagarwal7479 Aug 29, 2024
1965c72
Merge branch 'develop' of https://github.com/Viditagarwal7479/cvat in…
Viditagarwal7479 Aug 29, 2024
e5910e9
corrected paths of imports which changed on merging `develop` with cu…
Viditagarwal7479 Aug 29, 2024
d9f72fd
Merge branch 'gsoc/consensus-feature' of https://github.com/Viditagar…
Viditagarwal7479 Aug 29, 2024
7e00278
Merge branch 'gsoc/consensus-feature' into merge_consensus_jobs
Viditagarwal7479 Aug 29, 2024
15e2501
imporved info of `agreementScoreThreshold` in Consensus Settings page…
Viditagarwal7479 Aug 29, 2024
6c857b9
Merge branch 'merge_consensus_jobs' of https://github.com/Viditagarwa…
Viditagarwal7479 Aug 29, 2024
91a120c
added remembering of collapsed and uncollapsed state of regular job i…
Viditagarwal7479 Aug 31, 2024
b4ac890
corrected job filter in consensus reports api implementation
Viditagarwal7479 Sep 2, 2024
73aa75b
removed Consensus Conflict Type of `WrongGroupError` and `FailedAttrV…
Viditagarwal7479 Sep 2, 2024
1f12625
made class variables to instance variables. Causing issue when multip…
Viditagarwal7479 Sep 2, 2024
3883993
typo of task as task`s`
Viditagarwal7479 Sep 2, 2024
7d1965a
handled `assignee` can be null on assignee view in Consensus Analytics
Viditagarwal7479 Sep 2, 2024
d28826d
removed unwanted `console.log` statements
Viditagarwal7479 Sep 2, 2024
053a7dd
updated migrations based on removed consensus conflict types
Viditagarwal7479 Sep 2, 2024
42fed6b
updated `schema.yml`
Viditagarwal7479 Sep 2, 2024
85311d6
replaced floor division with ceil division
Viditagarwal7479 Sep 3, 2024
eb9c6e4
made public func as private where needed
Viditagarwal7479 Sep 3, 2024
b0a762d
corrected spelling of children
Viditagarwal7479 Sep 3, 2024
32c5c6a
renamed `new_intersect_merge.py` and `merge_consensus_jobs.py`
Viditagarwal7479 Sep 3, 2024
211425e
reformatted python files
Viditagarwal7479 Sep 3, 2024
864791d
added `consensus` as annotation source type
Viditagarwal7479 Sep 3, 2024
4186fe2
made validation on `oks_sigma` less restrictive in consensus settings
Viditagarwal7479 Sep 3, 2024
a107c2c
remvoed unnessecary condition as job type will be among the 3 known t…
Viditagarwal7479 Sep 3, 2024
6ae0ed7
nothing to show in assignee list if assignee is null
Viditagarwal7479 Sep 4, 2024
8f8091f
updated `schema.yml`
Viditagarwal7479 Sep 4, 2024
0f758bb
moved `consensus_report_id` in filter_fields for assignee report
Viditagarwal7479 Sep 4, 2024
488ebbd
fixed merging of `Point` annotations
Viditagarwal7479 Sep 4, 2024
909b08c
fixed mergeing of `PolyLine` annotations
Viditagarwal7479 Sep 7, 2024
50007a2
removed extra `s` from `consensus/assignee_report` endpoint
Viditagarwal7479 Sep 7, 2024
8916612
moved server health check while starting test container in try for sl…
Viditagarwal7479 Sep 7, 2024
38b9691
added endpoints for consensus objects for accessing them in test cases
Viditagarwal7479 Sep 7, 2024
86eeb0e
added more reliable way to get consensus error type
Viditagarwal7479 Sep 8, 2024
da956e5
reformatted python files
Viditagarwal7479 Sep 8, 2024
5e89857
added `parent_id` to Consensus Reports
Viditagarwal7479 Sep 8, 2024
0c17d44
used `parent_id` in ConsensusConflictsViewSet also
Viditagarwal7479 Sep 9, 2024
33e4b9d
updated `schama.yml` with `parent_id`
Viditagarwal7479 Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,28 @@
},
"console": "internalConsole"
},
{
"name": "server: RQ - consensus",
"type": "debugpy",
"request": "launch",
"stopOnEntry": false,
"justMyCode": false,
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"rqworker",
"consensus",
"--worker-class",
"cvat.rqworker.SimpleWorker"
],
"django": true,
"cwd": "${workspaceFolder}",
"env": {
"DJANGO_LOG_SERVER_HOST": "localhost",
"DJANGO_LOG_SERVER_PORT": "8282"
},
"console": "internalConsole"
},
{
"name": "server: migrate",
"type": "debugpy",
Expand Down Expand Up @@ -537,7 +559,8 @@
"server: RQ - scheduler",
"server: RQ - quality reports",
"server: RQ - analytics reports",
"server: RQ - cleaning"
"server: RQ - cleaning",
"server: RQ - consensus",
]
}
]
Expand Down
15 changes: 13 additions & 2 deletions cvat-core/src/api-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Webhook from './webhook';
import { ArgumentError } from './exceptions';
import {
AnalyticsReportFilter, QualityConflictsFilter, QualityReportsFilter,
QualitySettingsFilter, SerializedAsset,
SettingsFilter, SerializedAsset,
Viditagarwal7479 marked this conversation as resolved.
Show resolved Hide resolved
} from './server-response-types';
import QualityReport from './quality-report';
import QualityConflict, { ConflictSeverity } from './quality-conflict';
Expand All @@ -42,6 +42,7 @@ import { listActions, registerAction, runActions } from './annotations-actions';
import { JobType } from './enums';
import { PaginatedResource } from './core-types';
import CVATCore from '.';
import ConsensusSettings from './consensus-settings';

function implementationMixin(func: Function, implementation: Function): void {
Object.assign(func, { implementation });
Expand Down Expand Up @@ -505,7 +506,7 @@ export default function implementAPI(cvat: CVATCore): CVATCore {

return mergedConflicts;
});
implementationMixin(cvat.analytics.quality.settings.get, async (filter: QualitySettingsFilter) => {
implementationMixin(cvat.analytics.quality.settings.get, async (filter: SettingsFilter) => {
checkFilter(filter, {
taskID: isInteger,
});
Expand All @@ -515,6 +516,16 @@ export default function implementAPI(cvat: CVATCore): CVATCore {
const settings = await serverProxy.analytics.quality.settings.get(params);
return new QualitySettings({ ...settings });
});
implementationMixin(cvat.consensus.settings.get, async (filter: SettingsFilter) => {
checkFilter(filter, {
taskID: isInteger,
});

const params = fieldsToSnakeCase(filter);

const settings = await serverProxy.consensus.settings.get(params);
return new ConsensusSettings({ ...settings });
});
implementationMixin(cvat.analytics.performance.reports, async (filter: AnalyticsReportFilter) => {
checkFilter(filter, {
jobID: isInteger,
Expand Down
9 changes: 9 additions & 0 deletions cvat-core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ function build(): CVATCore {
},
},
},
consensus: {
settings: {
async get(filter = {}) {
const result = await PluginRegistry.apiWrapper(cvat.consensus.settings.get, filter);
return result;
},
},
},
classes: {
User,
Project: implementProject(Project),
Expand Down Expand Up @@ -418,6 +426,7 @@ function build(): CVATCore {
cvat.organizations = Object.freeze(cvat.organizations);
cvat.webhooks = Object.freeze(cvat.webhooks);
cvat.analytics = Object.freeze(cvat.analytics);
cvat.consensus = Object.freeze(cvat.consensus);
cvat.classes = Object.freeze(cvat.classes);
cvat.utils = Object.freeze(cvat.utils);

Expand Down
81 changes: 81 additions & 0 deletions cvat-core/src/consensus-settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Copyright (C) 2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

import { SerializedConsensusSettingsData } from './server-response-types';
import PluginRegistry from './plugins';
import serverProxy from './server-proxy';

export default class ConsensusSettings {
#id: number;
#task: number;
#iouThreshold: number;
#quorum: number;
#agreementScoreThreshold: number;

constructor(initialData: SerializedConsensusSettingsData) {
this.#id = initialData.id;
this.#task = initialData.task;
this.#iouThreshold = initialData.iou_threshold;
this.#agreementScoreThreshold = initialData.agreement_score_threshold;
this.#quorum = initialData.quorum;
}

get id(): number {
return this.#id;
}

get task(): number {
return this.#task;
}

get iouThreshold(): number {
return this.#iouThreshold;
}

set iouThreshold(newVal: number) {
this.#iouThreshold = newVal;
}

get quorum(): number {
return this.#quorum;
}

set quorum(newVal: number) {
this.#quorum = newVal;
}

get agreementScoreThreshold(): number {
return this.#agreementScoreThreshold;
}

set agreementScoreThreshold(newVal: number) {
this.#agreementScoreThreshold = newVal;
}

public toJSON(): SerializedConsensusSettingsData {
const result: SerializedConsensusSettingsData = {
iou_threshold: this.#iouThreshold,
quorum: this.#quorum,
agreement_score_threshold: this.#agreementScoreThreshold,
};

return result;
}

public async save(): Promise<ConsensusSettings> {
const result = await PluginRegistry.apiWrapper.call(this, ConsensusSettings.prototype.save);
return result;
}
}

Object.defineProperties(ConsensusSettings.prototype.save, {
implementation: {
writable: false,
enumerable: false,
value: async function implementation() {
const result = await serverProxy.consensus.settings.update(this.id, this.toJSON());
return new ConsensusSettings(result);
},
},
});
10 changes: 8 additions & 2 deletions cvat-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
//
// SPDX-License-Identifier: MIT

import ConsensusSettings from 'consensus-settings';
import {
AnalyticsReportFilter, QualityConflictsFilter, QualityReportsFilter, QualitySettingsFilter,
AnalyticsReportFilter, QualityConflictsFilter, QualityReportsFilter, SettingsFilter,
} from './server-response-types';
import PluginRegistry from './plugins';
import serverProxy from './server-proxy';
Expand Down Expand Up @@ -131,12 +132,17 @@ export default interface CVATCore {
webhooks: {
get: any;
};
consensus: {
settings: {
get: (filter: SettingsFilter) => Promise<ConsensusSettings>;
};
}
analytics: {
quality: {
reports: (filter: QualityReportsFilter) => Promise<PaginatedResource<QualityReport>>;
conflicts: (filter: QualityConflictsFilter) => Promise<QualityConflict[]>;
settings: {
get: (filter: QualitySettingsFilter) => Promise<QualitySettings>;
get: (filter: SettingsFilter) => Promise<QualitySettings>;
};
};
performance: {
Expand Down
73 changes: 71 additions & 2 deletions cvat-core/src/server-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import {
SerializedAbout, SerializedRemoteFile, SerializedUserAgreement,
SerializedRegister, JobsFilter, SerializedJob, SerializedGuide, SerializedAsset, SerializedAPISchema,
SerializedInvitationData, SerializedCloudStorage, SerializedFramesMetaData, SerializedCollection,
SerializedQualitySettingsData, APIQualitySettingsFilter, SerializedQualityConflictData, APIQualityConflictsFilter,
SerializedQualitySettingsData, APISettingsFilter, SerializedQualityConflictData, APIQualityConflictsFilter,
SerializedQualityReportData, APIQualityReportsFilter, SerializedAnalyticsReport, APIAnalyticsReportFilter,
SerializedConsensusSettingsData,
} from './server-response-types';
import { PaginatedResource } from './core-types';
import { Storage } from './storage';
Expand Down Expand Up @@ -796,6 +797,30 @@ async function deleteTask(id: number, organizationID: string | null = null): Pro
}
}

async function mergeConsensusJobs(id: number): Promise<void> {
const { backendAPI } = config;
const url = `${backendAPI}/tasks/${id}/aggregate`;

return new Promise<void>((resolve, reject) => {
async function request() {
try {
const response = await Axios.put(url);
const { status } = response;
if (status === 202) {
setTimeout(request, 3000);
} else if (status === 201) {
resolve();
} else {
reject(generateError(response));
}
} catch (errorData) {
reject(generateError(errorData));
}
}
setTimeout(request);
});
}

async function getLabels(filter: {
job_id?: number,
task_id?: number,
Expand Down Expand Up @@ -2334,7 +2359,7 @@ async function createAsset(file: File, guideId: number): Promise<SerializedAsset
}

async function getQualitySettings(
filter: APIQualitySettingsFilter,
filter: APISettingsFilter,
): Promise<SerializedQualitySettingsData> {
const { backendAPI } = config;

Expand Down Expand Up @@ -2369,6 +2394,42 @@ async function updateQualitySettings(
}
}

async function getConsensusSettings(
filter: APISettingsFilter,
): Promise<SerializedConsensusSettingsData> {
const { backendAPI } = config;

try {
const response = await Axios.get(`${backendAPI}/consensus/settings`, {
params: {
...filter,
},
});

return response.data.results[0];
} catch (errorData) {
throw generateError(errorData);
}
}

async function updateConsensusSettings(
settingsID: number,
settingsData: SerializedConsensusSettingsData,
): Promise<SerializedConsensusSettingsData> {
const params = enableOrganization();
const { backendAPI } = config;

try {
const response = await Axios.patch(`${backendAPI}/consensus/settings/${settingsID}`, settingsData, {
params,
});

return response.data;
} catch (errorData) {
throw generateError(errorData);
}
}

async function getQualityConflicts(
filter: APIQualityConflictsFilter,
): Promise<SerializedQualityConflictData[]> {
Expand Down Expand Up @@ -2548,6 +2609,7 @@ export default Object.freeze({
getPreview: getPreview('tasks'),
backup: backupTask,
restore: restoreTask,
mergeConsensusJobs,
}),

labels: Object.freeze({
Expand Down Expand Up @@ -2666,4 +2728,11 @@ export default Object.freeze({
}),
}),
}),

consensus: Object.freeze({
settings: Object.freeze({
get: getConsensusSettings,
update: updateConsensusSettings,
}),
}),
});
12 changes: 10 additions & 2 deletions cvat-core/src/server-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ export interface SerializedOrganization {
contact?: SerializedOrganizationContact,
}

export interface APIQualitySettingsFilter extends APICommonFilterParams {
export interface APISettingsFilter extends APICommonFilterParams {
task_id?: number;
}
export type QualitySettingsFilter = Camelized<APIQualitySettingsFilter>;
export type SettingsFilter = Camelized<APISettingsFilter>;

export interface SerializedQualitySettingsData {
id?: number;
Expand All @@ -257,6 +257,14 @@ export interface SerializedQualitySettingsData {
compare_attributes?: boolean;
}

export interface SerializedConsensusSettingsData {
id?: number;
task?: number;
agreement_score_threshold?: number;
quorum?: number;
iou_threshold?: number;
}

export interface APIQualityConflictsFilter extends APICommonFilterParams {
report_id?: number;
}
Expand Down
8 changes: 8 additions & 0 deletions cvat-core/src/session-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,14 @@ export function implementTask(Task: typeof TaskClass): typeof TaskClass {
},
});

Object.defineProperty(Task.prototype.mergeConsensusJobs, 'implementation', {
value: function mergeConsensusJobsImplementation(
this: TaskClass,
): ReturnType<typeof TaskClass.prototype.mergeConsensusJobs> {
return serverProxy.tasks.mergeConsensusJobs(this.id);
},
});

Object.defineProperty(Task.prototype.issues, 'implementation', {
value: function issuesImplementation(
this: TaskClass,
Expand Down
5 changes: 5 additions & 0 deletions cvat-core/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,11 @@ export class Task extends Session {
return result;
}

async mergeConsensusJobs(): Promise<void> {
const result = await PluginRegistry.apiWrapper.call(this, Task.prototype.mergeConsensusJobs);
return result;
}

async backup(targetStorage: Storage, useDefaultSettings: boolean, fileName?: string): Promise<string | void> {
const result = await PluginRegistry.apiWrapper.call(
this,
Expand Down
Loading