annotator

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2026 License: GPL-3.0, GPL-3.0-or-later Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddIcon = `` /* 270-byte string literal not displayed */
View Source
var BadgeIcon = `` /* 616-byte string literal not displayed */
View Source
var TrashIcon = `` /* 636-byte string literal not displayed */

Functions

func MakeAnnotoriousScript

func MakeAnnotoriousScript(imageId string, collection string) (*Node, error)
func MakeLink(imageId, collection string) string

func RegionTableBody

func RegionTableBody(title string, rows []RegionRow) Node

func ShortenUUID

func ShortenUUID(id string) string

func ToAddBoxRequest

func ToAddBoxRequest(r AnnotoriousBoxRequest) (*addbox.Request, error)

func ToUpdateBoxRequest

func ToUpdateBoxRequest(r AnnotoriousBoxModel) (*updbox.Request, error)

Types

type AnnotationView

type AnnotationView struct {
	ImageView
	ImageInfosView
	AnnotationsListView
	ScrollerView
	// contains filtered or unexported fields
}

func NewAnnotationView

func NewAnnotationView() *AnnotationView

func (*AnnotationView) AddBox

func (v *AnnotationView) AddBox(b v.BoundingBox)

func (*AnnotationView) AddLabel

func (v *AnnotationView) AddLabel(l v.ImageLabel)

func (*AnnotationView) DeleteAnnotation

func (v *AnnotationView) DeleteAnnotation(string)

func (*AnnotationView) Error

func (v *AnnotationView) Error(err error)

func (*AnnotationView) RenderAll

func (v *AnnotationView) RenderAll(w http.ResponseWriter)

func (*AnnotationView) RenderAnnotationList

func (v *AnnotationView) RenderAnnotationList(w http.ResponseWriter)

func (*AnnotationView) RenderAnnotations

func (v *AnnotationView) RenderAnnotations(w http.ResponseWriter)

func (*AnnotationView) SetAnnotations

func (v *AnnotationView) SetAnnotations(boxes []v.BoundingBox, imageLabels []v.ImageLabel)

func (*AnnotationView) SetAvailableImageLabels

func (v *AnnotationView) SetAvailableImageLabels(labels []string)

func (*AnnotationView) SetAvailableLabels

func (v *AnnotationView) SetAvailableLabels(labels []string)

func (*AnnotationView) SetImage

func (v *AnnotationView) SetImage(image v.Image)

func (*AnnotationView) SetImageInfo

func (v *AnnotationView) SetImageInfo(info v.ImageInfo)

func (*AnnotationView) SetScroller

func (v *AnnotationView) SetScroller(buttons v.ScrollerButtons)

func (*AnnotationView) UpdateBox

func (v *AnnotationView) UpdateBox(b v.BoundingBox)

func (*AnnotationView) UpdateLabel

func (v *AnnotationView) UpdateLabel(a v.Annotation)

type AnnotationsListView

type AnnotationsListView struct{}

func (*AnnotationsListView) Build

func (v *AnnotationsListView) Build(boxes []view.BoundingBox, imageLabels []view.ImageLabel, availableLabels []string) Node

type AnnotatorState

type AnnotatorState struct {
	ImageId          string
	Collection       string
	EnableAnnotation bool
}

type AnnotoriousBody

type AnnotoriousBody struct {
	Purpose string `json:"purpose"`
	Value   string `json:"value"`
}

type AnnotoriousBoxModel

type AnnotoriousBoxModel struct {
	AnnotationId string            `json:"id"`
	Properties   Properties        `json:"properties"`
	Target       BoxTarget         `json:"target"`
	Bodies       []AnnotoriousBody `json:"bodies"`
}

func ConvertToAnnotorious

func ConvertToAnnotorious(boxes []view.BoundingBox) []AnnotoriousBoxModel

func (AnnotoriousBoxModel) ExtractCoordinates

func (b AnnotoriousBoxModel) ExtractCoordinates() BoxCoordinates

type AnnotoriousBoxRequest

type AnnotoriousBoxRequest struct {
	ImageId    string              `json:"image_id"`
	Collection string              `json:"collection"`
	Annotation AnnotoriousBoxModel `json:"annotation"`
	Label      string              `json:"label"`
}

type Bounds

type Bounds struct {
	MinX float32 `json:"minX"`
	MinY float32 `json:"minY"`
	MaxX float32 `json:"maxX"`
	MaxY float32 `json:"maxY"`
}

type BoxCoordinates

type BoxCoordinates struct {
	Xc     float32
	Yc     float32
	Width  float32
	Height float32
}

type BoxGeometry

type BoxGeometry struct {
	XTopLeft float32 `json:"x"`
	YTopLeft float32 `json:"y"`
	W        float32 `json:"w"`
	H        float32 `json:"h"`
	Bounds   Bounds  `json:"bounds"`
}

type BoxSelector

type BoxSelector struct {
	Type     string      `json:"type"`
	Geometry BoxGeometry `json:"geometry"`
}

type BoxTarget

type BoxTarget struct {
	Selector BoxSelector `json:"selector"`
}

type ImageInfosView

type ImageInfosView struct {
	// contains filtered or unexported fields
}

func (*ImageInfosView) Build

func (p *ImageInfosView) Build(info view.ImageInfo) Node

type ImageLabelRow

type ImageLabelRow struct {
	Label string
	Id    string
}

func (ImageLabelRow) Render

func (r ImageLabelRow) Render() Node

type ImageLabelTable

type ImageLabelTable struct {
	Fields []string
	Rows   []ImageLabelRow
}

func (*ImageLabelTable) AddImageLabel

func (t *ImageLabelTable) AddImageLabel(l view.ImageLabel)

func (*ImageLabelTable) Build

func (t *ImageLabelTable) Build() Node

type ImageView

type ImageView struct {
	// contains filtered or unexported fields
}

func (*ImageView) Build

func (p *ImageView) Build(image view.Image) Node

type LabelModalKind

type LabelModalKind int
const (
	RegionLabelModal LabelModalKind = iota
	ImageLabelModal
)

type LabelSelector

type LabelSelector struct {
	Labels         []string
	SelectorIsOpen bool
	Selected       *string
	AnnotationId   string
}

type NewLabelModal

type NewLabelModal struct {
	Labels         []string
	SelectorIsOpen bool
	Selected       *string
	SubmissionFn   string
	ModalName      string
}

type Properties

type Properties struct {
	Color string `json:"color"`
	Label string `json:"label"`
}

type RegionRow

type RegionRow struct {
	Values []Node
}

func (RegionRow) Render

func (r RegionRow) Render() Node

type RegionTable

type RegionTable struct {
	Rows            []RegionRow
	AvailableLabels []string
}

func (*RegionTable) AddBox

func (t *RegionTable) AddBox(b view.BoundingBox)

func (*RegionTable) Build

func (t *RegionTable) Build(title string) Node

type Request

type Request struct {
	ImageId    string
	Collection string
}

type ScrollerView

type ScrollerView struct {
}

func (*ScrollerView) Render

func (p *ScrollerView) Render(buttons view.ScrollerButtons) Node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL