You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
647 B

  1. import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
  2. import { BoundingBox } from '@/domain/models/tasks/boundingBox'
  3. export class APIBoundingBoxRepository extends AnnotationRepository<BoundingBox> {
  4. labelName = 'bboxes'
  5. toModel(item: { [key: string]: any }): BoundingBox {
  6. return new BoundingBox(item.id, item.uuid, item.label, item.x, item.y, item.width, item.height)
  7. }
  8. toPayload(item: BoundingBox): { [key: string]: any } {
  9. return {
  10. id: item.id,
  11. uuid: item.uuid,
  12. label: item.label,
  13. x: item.x,
  14. y: item.y,
  15. width: item.width,
  16. height: item.height
  17. }
  18. }
  19. }