-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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] Creating Consensus Job #7974
[GSoC'24] Creating Consensus Job #7974
Conversation
…rce_job_id under Job
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes introduce two new properties, Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant UI as CVAT UI
participant Backend as CVAT Backend
participant DB as Database
User->>UI: Create Task
UI->>Backend: Send Task Data (including consensusJobPerSegment)
Backend->>DB: Save Task Data
DB-->>Backend: Confirmation
Backend-->>UI: Task Created
UI-->>User: Task Creation Confirmation
User->>UI: View Task Details
UI->>Backend: Fetch Task Details
Backend->>DB: Retrieve Task Data
DB-->>Backend: Task Data (including consensusJobPerSegment)
Backend-->>UI: Task Details
UI-->>User: Display Task Details
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (22)
- cvat-core/src/server-response-types.ts (2 hunks)
- cvat-core/src/session-implementation.ts (1 hunks)
- cvat-core/src/session.ts (6 hunks)
- cvat-sdk/cvat_sdk/core/proxies/tasks.py (2 hunks)
- cvat-ui/src/actions/tasks-actions.ts (2 hunks)
- cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx (4 hunks)
- cvat/apps/dataset_manager/bindings.py (2 hunks)
- cvat/apps/dataset_manager/project.py (1 hunks)
- cvat/apps/dataset_manager/task.py (1 hunks)
- cvat/apps/engine/admin.py (1 hunks)
- cvat/apps/engine/backup.py (1 hunks)
- cvat/apps/engine/migrations/0079_job_source_job_id_task_consensus_job_per_segment.py (1 hunks)
- cvat/apps/engine/migrations/0080_alter_job_source_job_id.py (1 hunks)
- cvat/apps/engine/migrations/0081_alter_job_source_job_id.py (1 hunks)
- cvat/apps/engine/migrations/0082_alter_task_consensus_job_per_segment.py (1 hunks)
- cvat/apps/engine/migrations/0083_alter_task_consensus_job_per_segment.py (1 hunks)
- cvat/apps/engine/migrations/0084_remove_task_consensus_job_per_segment_and_more.py (1 hunks)
- cvat/apps/engine/migrations/0085_alter_data_consensus_job_per_segment.py (1 hunks)
- cvat/apps/engine/migrations/0086_alter_data_consensus_job_per_segment.py (1 hunks)
- cvat/apps/engine/models.py (2 hunks)
- cvat/apps/engine/serializers.py (9 hunks)
- cvat/apps/engine/task.py (1 hunks)
Files skipped from review due to trivial changes (9)
- cvat/apps/dataset_manager/project.py
- cvat/apps/engine/backup.py
- cvat/apps/engine/migrations/0079_job_source_job_id_task_consensus_job_per_segment.py
- cvat/apps/engine/migrations/0080_alter_job_source_job_id.py
- cvat/apps/engine/migrations/0081_alter_job_source_job_id.py
- cvat/apps/engine/migrations/0082_alter_task_consensus_job_per_segment.py
- cvat/apps/engine/migrations/0083_alter_task_consensus_job_per_segment.py
- cvat/apps/engine/migrations/0085_alter_data_consensus_job_per_segment.py
- cvat/apps/engine/migrations/0086_alter_data_consensus_job_per_segment.py
Additional comments not posted (27)
cvat/apps/engine/migrations/0084_remove_task_consensus_job_per_segment_and_more.py (2)
13-16
: The removal of theconsensus_job_per_segment
field from thetask
model is correctly implemented.
17-21
: The addition of theconsensus_job_per_segment
field to thedata
model with a default value and allowing blank entries is correctly implemented.cvat/apps/engine/admin.py (1)
62-62
: The addition ofconsensus_job_per_segment
to theDataAdmin
fields and marking it as read-only is correctly implemented.cvat-ui/src/actions/tasks-actions.ts (2)
216-216
: Initialization ofconsensus_job_per_segment
with a default value of0
in the task creation description is correctly implemented.
255-257
: The conditional setting ofconsensus_job_per_segment
based on user input is correctly implemented.cvat-core/src/server-response-types.ts (2)
123-123
: The addition ofconsensus_job_per_segment
to theSerializedTask
interface is correctly implemented.
150-150
: The addition ofsource_job_id
to theSerializedJob
interface, allowing bothnumber
andnull
, is correctly implemented.cvat-sdk/cvat_sdk/core/proxies/tasks.py (1)
Line range hint
81-99
: The addition ofconsensus_job_per_segment
with a default value of0
in theupload_data
method, and its inclusion in thekeep
list for data filtering, is correctly implemented.cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx (2)
52-52
: The addition of the optionalconsensusJobPerSegment
field to theAdvancedConfiguration
interface is correctly implemented.
330-337
: The implementation of therenderConsensusJobPerSegment
method, including validation for non-negative integers and its placement in the form, is correctly implemented.cvat-core/src/session-implementation.ts (1)
486-486
: The addition ofconsensus_job_per_segment
to the task specification is correctly implemented.Verification successful
The addition of
consensus_job_per_segment
is correctly handled in various parts of the system, includingtasks-actions.ts
,session.ts
,session-implementation.ts
, andserver-response-types.ts
.
cvat-ui/src/actions/tasks-actions.ts
:
- Line:
consensus_job_per_segment: 0,
- Line:
description.consensus_job_per_segment = data.advanced.consensusJobPerSegment;
cvat-core/src/session.ts
:
- Line:
consensus_job_per_segment: undefined,
- Line:
get: () => data.consensus_job_per_segment,
cvat-core/src/session-implementation.ts
:
- Line:
consensus_job_per_segment: this.consensusJobPerSegment,
cvat-core/src/server-response-types.ts
:
- Line:
consensus_job_per_segment: number;
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `consensus_job_per_segment` is correctly handled in all related parts of the system. # Test: Search for the usage of `consensus_job_per_segment` in the TypeScript files. rg --type typescript $'consensus_job_per_segment'Length of output: 83
Script:
#!/bin/bash # Description: Verify that `consensus_job_per_segment` is correctly handled in all related parts of the system. # Test: Search for the usage of `consensus_job_per_segment` in all TypeScript files. rg 'consensus_job_per_segment' --glob '*.ts'Length of output: 599
cvat/apps/dataset_manager/task.py (1)
733-733
: Ensure proper filtering of jobs based onsource_job_id
.This change correctly implements the filtering of annotation jobs to exclude those that are sourced from other jobs, aligning with the new functionality for consensus jobs.
cvat/apps/engine/models.py (2)
235-235
: Ensure the default value forconsensus_job_per_segment
aligns with system requirements.Verification successful
The default value for
consensus_job_per_segment
is consistently set to 0 across the codebase.
cvat/apps/engine/models.py
:consensus_job_per_segment = models.IntegerField(default=0, blank=True)
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the default value of 0 for consensus_job_per_segment is consistent across all related files. # Test: Search for the default value across all Python files. Expect: Consistent default value of 0. rg --type python 'consensus_job_per_segment' --files-with-matches | xargs rg 'default=0'Length of output: 5318
681-681
: Check if allowingnull
forsource_job_id
aligns with the data integrity requirements of the system.Verification successful
Allowing
null
forsource_job_id
aligns with the data integrity requirements of the system.The search results indicate that
source_job_id
is used in various parts of the codebase, including models, serializers, and migrations. Specifically, the following points are noteworthy:
- In
cvat/apps/engine/models.py
,source_job_id
is defined asnull=True, blank=True, default=None
.- In
cvat/apps/engine/serializers.py
,source_job_id
is aReadOnlyField
withallow_null=True
.- In
cvat/apps/dataset_manager/task.py
, there is an instance wheresource_job_id
is explicitly set toNone
.These points suggest that the system is designed to handle
null
values forsource_job_id
, and this is consistent across the codebase.
- cvat/apps/engine/models.py
- cvat/apps/engine/serializers.py
- cvat/apps/dataset_manager/task.py
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that allowing null values for source_job_id is consistent and necessary across the system. # Test: Search for the usage of source_job_id in Python files. Expect: Proper handling of null values. rg --type python 'source_job_id' --files-with-matches | xargs rg 'if.*source_job_id'Length of output: 115
Script:
#!/bin/bash # Description: Verify that allowing null values for source_job_id is consistent and necessary across the system. # Test: Search for the usage of source_job_id in Python files. Expect: Proper handling of null values. rg --type py 'source_job_id' --files-with-matches | xargs rg 'if.*source_job_id'Length of output: 80
Script:
#!/bin/bash # Description: Gather more information about the usage and constraints of source_job_id. # Search for all occurrences of source_job_id in the codebase. rg --type py 'source_job_id' # Check for any related database constraints or migrations. fd -e sql -e py | xargs rg 'source_job_id'Length of output: 2725
cvat-core/src/session.ts (5)
457-457
: Addition ofsource_job_id
to theJob
class.This change aligns with the PR's objective to track the source job of a task, facilitating the creation of consensus jobs.
592-594
: Getter forsource_job_id
in theJob
class.Proper encapsulation of
source_job_id
with a getter ensures that the property is accessed in a controlled manner, which is a good practice in object-oriented programming.
674-674
: Addition ofconsensusJobPerSegment
to theTask
class.This addition supports the new functionality of handling consensus jobs per segment, as described in the PR summary.
729-729
: Initialization ofconsensus_job_per_segment
in theTask
constructor.Initializing this property in the constructor ensures that it is set up correctly when an instance of
Task
is created.
915-917
: Getter forconsensusJobPerSegment
in theTask
class.The implementation of a getter for
consensusJobPerSegment
follows best practices for data encapsulation and provides a clean API for accessing this property.cvat/apps/dataset_manager/bindings.py (2)
678-678
: Ensure proper handling ofsource_job_id
in the metadata.Verification successful
Ensure proper handling of
source_job_id
in the metadata.
cvat/apps/engine/serializers.py
:source_job_id
is defined as aReadOnlyField
.cvat/apps/engine/models.py
:source_job_id
is defined as aPositiveIntegerField
.cvat/apps/engine/task.py
:source_job_id
is used in theJob
model.cvat/apps/dataset_manager/task.py
:source_job_id
is used in a query filter.cvat/apps/dataset_manager/bindings.py
:source_job_id
is included in the metadata.These usages indicate that
source_job_id
is properly handled in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `source_job_id` is properly handled in all relevant places. # Test: Search for the usage of `source_job_id`. Expect: Proper handling in all relevant places. rg --type python $'source_job_id'Length of output: 63
Script:
#!/bin/bash # Description: Verify that `source_job_id` is properly handled in all relevant places. # Test: Search for the usage of `source_job_id`. Expect: Proper handling in all relevant places. rg 'source_job_id' --glob '*.py'Length of output: 1359
783-783
: Ensureconsensus_job_per_segment
is properly integrated and used where necessary.Verification successful
Ensure
consensus_job_per_segment
is properly integrated and used where necessary.The search results indicate that
consensus_job_per_segment
is indeed integrated and used in various parts of the codebase, including serializers, models, migrations, and other modules.
- Serializers:
cvat/apps/engine/serializers.py
- Task Processing:
cvat/apps/engine/task.py
- Backup:
cvat/apps/engine/backup.py
- Admin:
cvat/apps/engine/admin.py
- Models:
cvat/apps/engine/models.py
- Migrations: Multiple migration files
- Project Management:
cvat/apps/dataset_manager/project.py
- Bindings:
cvat/apps/dataset_manager/bindings.py
- UI Actions:
cvat-ui/src/actions/tasks-actions.ts
- Core Session:
cvat-core/src/session.ts
,cvat-core/src/session-implementation.ts
- Server Response Types:
cvat-core/src/server-response-types.ts
- SDK Proxies:
cvat-sdk/cvat_sdk/core/proxies/tasks.py
Given the extensive integration across different modules, it appears that
consensus_job_per_segment
is properly integrated and used where necessary.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `consensus_job_per_segment` is properly integrated and used where necessary. # Test: Search for the usage of `consensus_job_per_segment`. Expect: Proper integration and usage in all relevant places. rg --type python $'consensus_job_per_segment'Length of output: 75
Script:
#!/bin/bash # Description: Verify that `consensus_job_per_segment` is properly integrated and used where necessary. # Test: Search for the usage of `consensus_job_per_segment`. Expect: Proper integration and usage in all relevant places. rg 'consensus_job_per_segment'Length of output: 4002
cvat/apps/engine/serializers.py (6)
596-596
: Addition ofsource_job_id
field inJobReadSerializer
.This field addition aligns with the PR's objective to support job sourcing functionalities.
968-971
: Addition ofconsensus_job_per_segment
field inDataSerializer
.This field supports the new functionality for consensus jobs per segment, which is crucial for the task segmentation feature.
1104-1104
: Addition ofconsensus_job_per_segment
field inTaskReadSerializer
.Proper integration of the new field to support consensus job configurations at the task level.
1129-1129
: Addition ofconsensus_job_per_segment
field inTaskWriteSerializer
.This addition allows setting the consensus job per segment during task creation or update, which is essential for the new functionality.
1195-1195
: Handling ofconsensus_job_per_segment
in the update method ofTaskWriteSerializer
.Proper handling of the new field during the update operations, ensuring that the consensus job settings are preserved or updated correctly.
Line range hint
1456-1470
: Addition ofconsensus_job_per_segment
field inDataMetaReadSerializer
.The field is correctly added to support reading consensus job configurations, which is necessary for proper data management and operations.
…ouldn't be updated once Task is created
In the above commit itself, I have added the constraint on the value of consensus jobs, [0, 10] - {1}. |
…ta model to Task model
…core_threshold which are set through extra configuration when creating task
…can be set through API call also when creating task initially
…multiple annotator mode
Thanks for pointing out it was happening due to conflicting |
and
@klakhov Does this look better? ![]() ![]() |
…b` to advanced block in task creation (cherry picked from commit df460ce)
…on form and set it's max value to 10
… into consensus-job
cvat-ui/src/components/create-task-page/create-task-content.tsx
Outdated
Show resolved
Hide resolved
|
Fixes Creating
consensus jobs
fornormal jobs
in #7973List of features present in this PR
Checklist
develop
branch- [ ] I have created a changelog fragment- [ ] I have updated the documentation accordingly- [ ] I have added tests to cover my changes- [ ] I have increased versions of npm packages if it is necessary(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
consensus job per segment
configuration option for tasks.source job ID
for jobs.Enhancements
consensus job per segment
.Bug Fixes
Migration
consensus job per segment
andsource job ID
.