Documentation ¶
Index ¶
- func DecodeSegmentToMask(segmentation SegmentationHelper) (mask []byte)
- func IoUBB(dt, gt BB, iscrowd []byte) (out []float64)
- func IoURLE(dt, gt *RLE, iscrowd []byte) (out []float64)
- func NonMaxSupBB(dt BB, thresh float64) (keep []bool)
- type Annotation
- type BB
- type Categories
- type Char
- type CocoApi
- func (api *CocoApi) GetAnnIds(imgIds, catIds, areaRng []int, iscrowd byte) (ids []int)
- func (api *CocoApi) GetCatIds(names, supCatNames []string) (ids []int)
- func (api *CocoApi) GetImgIds(catIds []int) (ids []int)
- func (api *CocoApi) LoadAnns(ids []int) (list []Annotation)
- func (api *CocoApi) LoadCats(ids []int) (list []Categories)
- func (api *CocoApi) LoadImgs(ids []int) (list []Image)
- func (api *CocoApi) ShowAnns(ids []int) ([]interface{}, error)
- type CocoData
- type Edge
- type Image
- type Information
- type License
- type PSSegmentInfo
- type RLE
- type Segment
- type SegmentationHelper
- type SegmentationPolygon
- type SegmentationRLE
- type SegmentationRLEUncompressed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSegmentToMask ¶
func DecodeSegmentToMask(segmentation SegmentationHelper) (mask []byte)
func IoUBB ¶
IoUBB -Compute intersection over union between bounding boxes. void bbIou( BB dt, BB gt, siz m, siz n, byte *iscrowd, double *o );
func IoURLE ¶
IoURLE Compute intersection over union between masks. void rleIou( RLE *dt, RLE *gt, siz m, siz n, byte *iscrowd, double *o );
func NonMaxSupBB ¶
NonMaxSupBB non-maximum suppression between bounding boxes void bbNms( BB dt, siz n, uint *keep, double thr );
Types ¶
type Annotation ¶
type Annotation struct { ImageID int `json:"image_id,omitempty"` // PanopticSegmentation does not have this property ID int `json:"id,omitempty"` // PanopticSegmentation and ImageCaption does not have this property CategoryID int `json:"category_id,omitempty"` Segmentation Segment `json:"segmentation,omitempty"` Area float32 `json:"area,omitempty"` Bbox [4]float32 `json:"bbox,omitempty"` // PanopticSegmentation and StuffSegmentation and ImageCaption does not have this property Iscrowd byte `json:"iscrowd,omitempty"` // ImageCaption own property Caption string `json:"caption,omitempty"` // KeypointDetection own property Keypoints []float32 `json:"keypoints,omitempty"` NumKeypoints int `json:"num_keypoints,omitempty"` // PanopticSegmentation own property FileName string `json:"file_name,omitempty"` SegmentsInfo []PSSegmentInfo `json:"segments_info,omitempty"` }
Annotation is the object detection annotation
type Categories ¶
type Categories struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Supercategory string `json:"supercategory,omitempty"` // KeypointDetection own property Keypoints []string `json:"keypoints,omitempty"` Skeleton []Edge `json:"skeleton,omitempty"` // PanopticSegmentation own property Isthing byte `json:"isthing,omitempty"` Color [3]uint32 `json:"color,omitempty"` }
Categories is the object detection categories.
type CocoApi ¶
type CocoApi struct {
// contains filtered or unexported fields
}
func NewCocoApi ¶
func (*CocoApi) LoadAnns ¶
func (api *CocoApi) LoadAnns(ids []int) (list []Annotation)
func (*CocoApi) LoadCats ¶
func (api *CocoApi) LoadCats(ids []int) (list []Categories)
type CocoData ¶
type CocoData struct { Info Information `json:"info,omitempty"` Images []Image `json:"images,omitempty"` Annotations []Annotation `json:"annotations,omitempty"` Licenses []License `json:"licenses,omitempty"` // ImageCaption does not have this property Categories []Categories `json:"categories,omitempty"` }
type Image ¶
type Image struct { ID int `json:"id,omitempty"` Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` FileName string `json:"file_name,omitempty"` License int `json:"license,omitempty"` FlickrURL string `json:"flickr_url,omitempty"` CocoURL string `json:"coco_url,omitempty"` DateCaptured string `json:"date_captured,omitempty"` }
Image is the image information and is shared between all the dataformats
type Information ¶
type Information struct { Year int `json:"year,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` Contributor string `json:"contributor,omitempty"` URL string `json:"url,omitempty"` DateCreated string `json:"date_created,omitempty"` }
Information is basic image and Coco information and is shared between all the data formats
type License ¶
type License struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` }
License is the license information and is shared between all the formats
type PSSegmentInfo ¶
type PSSegmentInfo struct { ID int `json:"id,omitempty"` CategoryID int `json:"category_id,omitempty"` Area int `json:"area,omitempty"` Bbox [4]float32 `json:"bbox,omitempty"` Iscrowd byte `json:"iscrowd,omitempty"` }
PSSegmentInfo contains segment info for the annotation
type RLE ¶
type RLE struct {
// contains filtered or unexported fields
}
RLE contains a pointer to an array of C.RLE
func RLEFromPoly ¶
RLEFromPoly Convert polygon to encoded mask. void rleFrPoly( RLE *R, const double *xy, siz k, siz h, siz w );
func (*RLE) AreaRLE ¶
AreaRLE - Compute area of encoded masks. void rleArea( const RLE *R, siz n, uint *a );
func (*RLE) Decode ¶
Decode binary masks encoded via RLE void rleDecode( const RLE *R, byte *mask, siz n );
func (*RLE) NonMaxSup ¶
NonMaxSup - Compute non-maximum suppression between bounding masks void rleNms( RLE *dt, siz n, uint *keep, double thr );
type Segment ¶
type Segment struct {
SegmentationHelper
}
Segment interface a placeholder for Segmentation data structures It can either be an RLE or a Polygon
func (*Segment) UnmarshalJSON ¶
type SegmentationHelper ¶
type SegmentationHelper interface {
SegmentationType() string
}
SegmentationHelper is used for segmentation
type SegmentationPolygon ¶
type SegmentationPolygon [][]float32
func (*SegmentationPolygon) SegmentationType ¶
func (s *SegmentationPolygon) SegmentationType() string
type SegmentationRLE ¶
type SegmentationRLE struct { Counts string `json:"counts,omitempty"` Size [2]uint32 `json:"size,omitempty"` }
func EncodeMaskToSegment ¶
func EncodeMaskToSegment(mask []byte, size [2]uint32) *SegmentationRLE
func EncodeRLEToSegment ¶
func EncodeRLEToSegment(segmentation *SegmentationRLEUncompressed) *SegmentationRLE
func (*SegmentationRLE) SegmentationType ¶
func (s *SegmentationRLE) SegmentationType() string
type SegmentationRLEUncompressed ¶
type SegmentationRLEUncompressed struct { Counts []uint32 `json:"counts,omitempty"` Size [2]uint32 `json:"size,omitempty"` }
func (*SegmentationRLEUncompressed) SegmentationType ¶
func (s *SegmentationRLEUncompressed) SegmentationType() string