Skip to content

Conversation

@bilalcodehub
Copy link
Contributor

This pull request introduces a new configuration parameter, cvat_labels_file, which allows users to specify a CSV file containing label definitions along with their attributes. The changes include:

New Method:

  • Implemented read_labels_from_file to parse the CSV file, reading each label and its attributes (provided as a JSON array string) and returning them in the required format.

Datastore Initialization:

  • Updated the init_datastore method to check if cvat_labels_file is provided in the configuration.
  • If present, the method loads labels using read_labels_from_file instead of relying solely on the configuration-provided labels.
  • This enhancement enables advanced CVAT features by leveraging detailed label attributes.

These updates aim to improve the flexibility and functionality of MONAILabel in endoscopy applications, making it easier to harness CVAT’s advanced capabilities. Please review and let me know if any further modifications are needed.

bilalcodehub and others added 3 commits March 29, 2025 00:59
@bilalcodehub
Copy link
Contributor Author

Hi MONAILabel team,

Could someone kindly review my pull request when possible? I’ve added support for reading label definitions from a CSV file by updating the main.py file in the endoscopy app. This allows labels to be defined via a file path using the following command:

monailabel start_server \
  --app surgvu/endoscopy \
  --studies surgvu/dataset/images \
  --conf models tooltracking \
  --conf epistemic_enabled true \
  --conf epistemic_top_k 84 \
  --conf cvat_segment_size 84 \
  --conf multi_gpu true \
  **--conf cvat_labels_file surgvu/endoscopy/labels.csv**

This change would be especially helpful for our workflow, as it saves us from manually modifying main.py each time we set up a new labeling task.

I’d really appreciate your review and approval when convenient.

Many thanks in advance!

Best regards,
Bilal

Signed-off-by: Muhammad Bilal <dotmbilal@gmail.com>
@bilalcodehub bilalcodehub force-pushed the read-cvat-labels-from-file branch 2 times, most recently from 00641d0 to 802e6ae Compare April 2, 2025 00:29
@SachidanandAlle
Copy link
Collaborator

SachidanandAlle commented Apr 2, 2025

Please fix the pressure commit errors and windows is dependency check

You can ignore DCO but the rest of the checks should be passing

For DCO the simple fix is use git -s option when committing.. something like git -s -m "my commit message"

…lient

Signed-off-by: bilalcodehub <dotmbilal@gmail.com>
@bilalcodehub bilalcodehub force-pushed the read-cvat-labels-from-file branch from 0f30a2b to da270d0 Compare April 2, 2025 01:03
pre-commit-ci bot and others added 3 commits April 2, 2025 01:04
…indows

Signed-off-by: bilalcodehub <dotmbilal@gmail.com>
Signed-off-by: bilalcodehub <dotmbilal@gmail.com>
@bilalcodehub
Copy link
Contributor Author

@SachidanandAlle, All checks now pass including the pre-commit and Windows dependency issues as they were locally. Let me know if anything else is needed before merge. Thanks!

@bilalcodehub
Copy link
Contributor Author

Please fix the pressure commit errors and windows is dependency check

You can ignore DCO but the rest of the checks should be passing

For DCO the simple fix is use git -s option when committing.. something like git -s -m "my commit message"

@SachidanandAlle: Can you please have a look at this? All checks have been passed now.

@SachidanandAlle SachidanandAlle merged commit 3016e0b into Project-MONAI:main Apr 3, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants