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.

19 lines
544 B

  1. import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
  2. import { Segment } from '@/domain/models/tasks/segmentation'
  3. export class APISegmentationRepository extends AnnotationRepository<Segment> {
  4. labelName = 'segments'
  5. toModel(item: { [key: string]: any }): Segment {
  6. return new Segment(item.id, item.uuid, item.label, item.points)
  7. }
  8. toPayload(item: Segment): { [key: string]: any } {
  9. return {
  10. id: item.id,
  11. uuid: item.uuid,
  12. label: item.label,
  13. points: item.points
  14. }
  15. }
  16. }