Skip to content

Commit

Permalink
update: add is_pre_annotated field to the sample response
Browse files Browse the repository at this point in the history
* chore: update scripts (#130)

* chore: update workflow (#128)

* fix: fix pre annoation exceptions (#120)

* chore(release): 1.0.7 [skip ci]

## [1.0.7](v1.0.6...v1.0.7) (2024-08-26)

### Bug Fixes

* fix pre annoation exceptions ([#120](#120)) ([bd61682](bd61682))

* docs: Update README.md

* docs: Update README.md

* docs: Update README_zh-CN.md (#126)

* docs: Update README_zh-CN.md

* docs: Update README_zh-CN.md

* chore: update workflow

---------

Co-authored-by: semantic-release-bot <[email protected]>

* fix: Upgrade frontend to v5.3.0-alpha.4. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.4)

* chore(release): 1.0.7-alpha.2 [skip ci]

## [1.0.7-alpha.2](v1.0.7-alpha.1...v1.0.7-alpha.2) (2024-10-25)

### Bug Fixes

* Upgrade frontend to v5.3.0-alpha.3. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.3) ([e8721d6](e8721d6))
* Upgrade frontend to v5.3.0-alpha.4. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.4) ([01fc3b5](01fc3b5))

* fix: Upgrade frontend to v5.3.0-alpha.5. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.5)

* chore(release): 1.0.7-alpha.3 [skip ci]

## [1.0.7-alpha.3](v1.0.7-alpha.2...v1.0.7-alpha.3) (2024-10-25)

### Bug Fixes

* Upgrade frontend to v5.3.0-alpha.5. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.5) ([f97601d](f97601d))

* fix: update notification action

* chore(release): 1.0.7-alpha.4 [skip ci]

## [1.0.7-alpha.4](v1.0.7-alpha.3...v1.0.7-alpha.4) (2024-10-28)

### Bug Fixes

* update notification action ([b6abe17](b6abe17))

* fix: update notification action

* chore(release): 1.0.7-alpha.5 [skip ci]

## [1.0.7-alpha.5](v1.0.7-alpha.4...v1.0.7-alpha.5) (2024-10-28)

### Bug Fixes

* update notification action ([04e0388](04e0388))

* fix: update notification action

* chore(release): 1.0.7-alpha.6 [skip ci]

## [1.0.7-alpha.6](v1.0.7-alpha.5...v1.0.7-alpha.6) (2024-10-28)

### Bug Fixes

* update notification action ([e9152c9](e9152c9))

* fix: update notification action

* chore(release): 1.0.7-alpha.7 [skip ci]

## [1.0.7-alpha.7](v1.0.7-alpha.6...v1.0.7-alpha.7) (2024-10-28)

### Bug Fixes

* update notification action ([046f47a](046f47a))

* fix: test notification action

* chore(release): 1.0.7-alpha.8 [skip ci]

## [1.0.7-alpha.8](v1.0.7-alpha.7...v1.0.7-alpha.8) (2024-10-28)

### Bug Fixes

* test notification action ([8fed078](8fed078))

* fix: test notification action

* chore(release): 1.0.7-alpha.9 [skip ci]

## [1.0.7-alpha.9](v1.0.7-alpha.8...v1.0.7-alpha.9) (2024-10-28)

### Bug Fixes

* test notification action ([851818e](851818e))

* fix: test notification action

* chore(release): 1.0.7-alpha.10 [skip ci]

## [1.0.7-alpha.10](v1.0.7-alpha.9...v1.0.7-alpha.10) (2024-10-28)

### Bug Fixes

* test notification action ([bc63ee5](bc63ee5))

* fix: test notification action

* chore(release): 1.0.7-alpha.11 [skip ci]

## [1.0.7-alpha.11](v1.0.7-alpha.10...v1.0.7-alpha.11) (2024-10-28)

### Bug Fixes

* test notification action ([83f43eb](83f43eb))

* fix: update notification action

* chore(release): 1.0.7-alpha.12 [skip ci]

## [1.0.7-alpha.12](v1.0.7-alpha.11...v1.0.7-alpha.12) (2024-10-28)

### Bug Fixes

* update notification action ([63286cb](63286cb))

* chore(release): 1.0.9-alpha.1 [skip ci]

## [1.0.9-alpha.1](v1.0.8...v1.0.9-alpha.1) (2024-10-28)

### Bug Fixes

* test notification action ([83f43eb](83f43eb))
* test notification action ([bc63ee5](bc63ee5))
* test notification action ([851818e](851818e))
* test notification action ([8fed078](8fed078))
* update notification action ([63286cb](63286cb))
* update notification action ([046f47a](046f47a))
* update notification action ([e9152c9](e9152c9))
* update notification action ([04e0388](04e0388))
* update notification action ([b6abe17](b6abe17))
* Upgrade frontend to v5.3.0-alpha.4. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.4) ([01fc3b5](01fc3b5))
* Upgrade frontend to v5.3.0-alpha.5. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.5) ([f97601d](f97601d))

* fix: Upgrade frontend to v5.3.0-alpha.6. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.6)

* chore(release): 1.0.9-alpha.2 [skip ci]

## [1.0.9-alpha.2](v1.0.9-alpha.1...v1.0.9-alpha.2) (2024-10-28)

### Bug Fixes

* Upgrade frontend to v5.3.0-alpha.6. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.6) ([9f5e698](9f5e698))

* fix: Upgrade frontend to v5.3.0-alpha.7. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.7)

* chore(release): 1.0.9-alpha.3 [skip ci]

## [1.0.9-alpha.3](v1.0.9-alpha.2...v1.0.9-alpha.3) (2024-10-28)

### Bug Fixes

* Upgrade frontend to v5.3.0-alpha.7. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/v5.3.0-alpha.7) ([7cb455e](7cb455e))

---------

Co-authored-by: semantic-release-bot <[email protected]>

* fix: upgrade frontend to 5.4.0 #106

* chore(release): 1.0.9 [skip ci]

## [1.0.9](v1.0.8...v1.0.9) (2024-10-29)

### Bug Fixes

* upgrade frontend to 5.4.0 [#106](#106) ([33b71be](33b71be))

* chore: delete test script

* fix: upgrade frontend to 5.4.1

* chore(release): 1.0.10 [skip ci]

## [1.0.10](v1.0.9...v1.0.10) (2024-10-29)

### Bug Fixes

* upgrade frontend to 5.4.1 ([73323b9](73323b9))

* docs: Create LICENSE

* fix: Update .VERSION

* chore(release): 1.1.0 [skip ci]

# [1.1.0](v1.0.10...v1.1.0) (2024-11-20)

### Bug Fixes

* add folder field to the json output ([3589d22](3589d22))
* fix [#69](#69) ([0baa13c](0baa13c))
* fix category name in pascal_voc and tfrecord format files ([b089074](b089074))
* fix file format in tfrecord ([77cba31](77cba31))
* optimize the task_pre_annotation table and service ([d38ed7b](d38ed7b))
* remove uuid prefix in attachment creation ([f0820ff](f0820ff))
* supports rotated image in yolo and tfrecord files ([4d5afdf](4d5afdf))
* Update .VERSION ([dae830a](dae830a))
* update alembic script ([97d6c08](97d6c08))
* update attributes in xml and pascal_voc ([0affd60](0affd60))

### Features

* supports exporting "csv" format files ([d35a93a](d35a93a))
* supports exporting "labelme" format files ([8d4ea8e](8d4ea8e))
* supports exporting "pascal voc" format files ([4344f99](4344f99))
* supports exporting "tfrecord" format files ([f728fd6](f728fd6))
* supports exporting "xml" format files ([b165cce](b165cce))
* supports exporting "yolo" format files ([b3d07b4](b3d07b4))
* supports labelu json file as the pre-annotation file ([2b4a9bd](2b4a9bd))

* fix: wrong indent in yolo conventer

Fixed an issue where multiple redundant files with the same name were generated when exporting YOLO format annotation files due to accidental indentation.

* chore(release): 1.1.1 [skip ci]

## [1.1.1](v1.1.0...v1.1.1) (2024-11-25)

### Bug Fixes

* wrong indent in yolo conventer ([5ebf616](5ebf616))

* fix: add full i18n supports

* chore(release): 1.1.2 [skip ci]

## [1.1.2](v1.1.1...v1.1.2) (2025-01-06)

### Bug Fixes

* add full i18n supports ([fdf9b76](fdf9b76))

* Update .VERSION

* fix: langOptions error

* chore(release): 1.1.3 [skip ci]

## [1.1.3](v1.1.2...v1.1.3) (2025-01-06)

### Bug Fixes

* langOptions error ([b2c9af5](b2c9af5))

* fix: no cache for html file

* chore(release): 1.1.4 [skip ci]

## [1.1.4](v1.1.3...v1.1.4) (2025-01-07)

### Bug Fixes

* no cache for html file ([9258822](9258822))

* fix: add is_pre_annotated field to the smaple response

* update: add is_pre_annotated field to the smaple response

---------

Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: Yonas <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent ee8fcd1 commit 1f9002b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions labelu/internal/application/service/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
from labelu.internal.application.response.sample import SampleResponse
from labelu.internal.application.response.attachment import AttachmentResponse

def is_sample_pre_annotated(db: Session, task_id: int, current_user: User, sample_name: str = None) -> Tuple[List[TaskPreAnnotation], int]:
def is_sample_pre_annotated(db: Session, task_id: int, current_user: User, sample_name: str | None = None) -> Tuple[List[TaskPreAnnotation], int]:
if sample_name is None:
return False

_, total = crud_pre_annotation.list_by(
db=db,
task_id=task_id,
Expand Down Expand Up @@ -108,7 +111,7 @@ async def list_by(
state=sample.state,
data=json.loads(sample.data),
annotated_count=sample.annotated_count,
is_pre_annotated=is_sample_pre_annotated(db=db, task_id=task_id, current_user=current_user, sample_name=sample.file.filename),
is_pre_annotated=is_sample_pre_annotated(db=db, task_id=task_id, current_user=current_user, sample_name=sample.file.filename if sample.file else None),
file=AttachmentResponse(id=sample.file.id, filename=sample.file.filename, url=sample.file.url) if sample.file else None,
created_at=sample.created_at,
created_by=UserResp(
Expand Down Expand Up @@ -152,7 +155,7 @@ async def get(
inner_id=sample.inner_id,
state=sample.state,
data=json.loads(sample.data),
is_pre_annotated=is_sample_pre_annotated(db=db, task_id=task_id, current_user=current_user, sample_name=sample.file.filename),
is_pre_annotated=is_sample_pre_annotated(db=db, task_id=task_id, current_user=current_user, sample_name=sample.file.filename if sample.file else None),
file=AttachmentResponse(id=sample.file.id, filename=sample.file.filename, url=sample.file.url) if sample.file else None,
annotated_count=sample.annotated_count,
created_at=sample.created_at,
Expand Down Expand Up @@ -230,7 +233,7 @@ async def patch(
inner_id=updated_sample.inner_id,
state=updated_sample.state,
data=json.loads(updated_sample.data),
is_pre_annotated=is_sample_pre_annotated(db=db, task_id=task_id, current_user=current_user, sample_name=sample.file.filename),
is_pre_annotated=is_sample_pre_annotated(db=db, task_id=task_id, current_user=current_user, sample_name=sample.file.filename if sample.file else None),
annotated_count=updated_sample.annotated_count,
created_at=updated_sample.created_at,
created_by=UserResp(
Expand Down

0 comments on commit 1f9002b

Please sign in to comment.