Documentation ¶
Index ¶
- Constants
- Variables
- func AddExecOpImpl(impl ExecOpImpl)
- func Clip(x, lo, hi int) int
- func CopyFile(src string, dst string) error
- func CopyOrSymlink(srcFname string, dstFname string, symlink bool) error
- func DecodeFile(t DataType, format string, metadata DataMetadata, fname string) (data interface{}, err error)
- func DrawLineOnCells(startX int, startY int, endX int, endY int, maxX int, maxY int) [][2]int
- func EncodeTypes(types []DataType) string
- func Ext(fname string) string
- func Ffprobe(fname string) (width int, height int, duration float64, err error)
- func FileExists(fname string) bool
- func FloorDiv(a, b int) int
- func GetExtFromFormat(dtype DataType, format string) string
- func GetGeometryBbox(g *geojson.Geometry) gomapinfer.Rectangle
- func GetImageDimsFromFile(fname string) ([2]int, error)
- func JsonGet(baseURL string, path string, response interface{}) error
- func JsonMarshal(x interface{}) []byte
- func JsonPost(baseURL string, path string, request interface{}, response interface{}) error
- func JsonPostForm(baseURL string, path string, request urllib.Values, response interface{}) error
- func JsonResponse(w http.ResponseWriter, x interface{})
- func JsonUnmarshal(bytes []byte, x interface{})
- func Mod(a, b int) int
- func ParseFloat(str string) float64
- func ParseInt(str string) int
- func ParseJsonRequest(w http.ResponseWriter, r *http.Request, x interface{}) error
- func ParseJsonResponse(resp *http.Response, response interface{}) error
- func PerFrame(items []Item, f func(pos int, datas []interface{}) error) error
- func ReadData(t DataType, format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func ReadJSONFile(fname string, res interface{})
- func ReadJsonData(r io.Reader, x interface{}) error
- func ReadTextFile(fname string) string
- func SeedRand()
- func SynchronizedReader(items []Item, n int, f func(pos int, length int, datas []interface{}) error) error
- func TrySynchronizedReader(items []Item, n int, f func(pos int, length int, datas []interface{}) error) error
- func WriteJsonData(x interface{}, w io.Writer) error
- type AnnotateDataset
- type ArrayDataSpec
- func (s ArrayDataSpec) Append(data interface{}, more interface{}) interface{}
- func (s ArrayDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s ArrayDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s ArrayDataSpec) Length(data interface{}) int
- func (s ArrayDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func (s ArrayDataSpec) ReadStream(r io.Reader) (interface{}, error)
- func (s ArrayDataSpec) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
- func (s ArrayDataSpec) Slice(data interface{}, i int, j int) interface{}
- func (s ArrayDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
- func (s ArrayDataSpec) WriteStream(data interface{}, w io.Writer) error
- func (s ArrayDataSpec) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
- type ArrayMetadata
- type ArrayReader
- type ArrayStreamHeader
- type ArrayWriter
- type ChanReader
- type ClosingSequenceReader
- type ClosingSequenceWriter
- type Cmd
- type CmdError
- type ColumnSpec
- type CommandOptions
- type ContainerRequest
- type ContainerResponse
- type DataMetadata
- type DataSpec
- type DataType
- type Dataset
- type Detection
- type DetectionJsonSpec
- func (s DetectionJsonSpec) Append(data interface{}, more interface{}) interface{}
- func (s DetectionJsonSpec) DecodeData(bytes []byte) (interface{}, error)
- func (s DetectionJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s DetectionJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
- func (s DetectionJsonSpec) Length(data interface{}) int
- func (s DetectionJsonSpec) Slice(data interface{}, i int, j int) interface{}
- type DetectionMetadata
- type EndRequest
- type ErrorSequenceReader
- type ErrorSequenceWriter
- type ExecBeginRequest
- type ExecBeginResponse
- type ExecInput
- type ExecNode
- type ExecOp
- type ExecOpConfig
- type ExecOpImpl
- type ExecOpImplProvider
- func (p ExecOpImplProvider) Config() ExecOpConfig
- func (p ExecOpImplProvider) GetImageName(node Runnable) (string, error)
- func (p ExecOpImplProvider) GetInputs(params string) []ExecInput
- func (p ExecOpImplProvider) GetJobOp(node Runnable) (JobOp, string)
- func (p ExecOpImplProvider) GetNeededInputs(node ExecNode, outputs []string) map[string][][]string
- func (p ExecOpImplProvider) GetOutputKeys(node ExecNode, inputs map[string][][]string) []string
- func (p ExecOpImplProvider) GetOutputs(params string, inputTypes map[string][]DataType) []ExecOutput
- func (p ExecOpImplProvider) GetTasks(node Runnable, items map[string][][]Item) ([]ExecTask, error)
- func (p ExecOpImplProvider) IsIncremental() bool
- func (p ExecOpImplProvider) Prepare(url string, node Runnable) (ExecOp, error)
- func (p ExecOpImplProvider) Requirements(node Runnable) map[string]int
- func (p ExecOpImplProvider) Resolve(node *VirtualNode, inputDatasets map[string][]Dataset, ...) ExecutionGraph
- func (p ExecOpImplProvider) Virtualize(node ExecNode) *VirtualNode
- type ExecOpProvider
- type ExecOutput
- type ExecParent
- type ExecTask
- type ExecTaskRequest
- type ExecutionGraph
- type ExtFromFormatDataSpec
- type FfmpegReader
- type FileDataSpec
- type FileMetadata
- type FileSequenceDataSpec
- type FileStreamHeader
- type FileTypeDataSpec
- func (s FileTypeDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s FileTypeDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s FileTypeDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func (s FileTypeDataSpec) ReadStream(r io.Reader) (interface{}, error)
- func (s FileTypeDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
- func (s FileTypeDataSpec) WriteStream(data interface{}, w io.Writer) error
- type FloatJsonSpec
- func (s FloatJsonSpec) Append(data interface{}, more interface{}) interface{}
- func (s FloatJsonSpec) DecodeData(bytes []byte) (interface{}, error)
- func (s FloatJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s FloatJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
- func (s FloatJsonSpec) Length(data interface{}) int
- func (s FloatJsonSpec) Slice(data interface{}, i int, j int) interface{}
- type GeoBbox
- type GeoImageDataSpec
- func (s GeoImageDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s GeoImageDataSpec) GetDefaultExtAndFormat(data interface{}, metadata_ DataMetadata) (ext string, format string)
- func (s GeoImageDataSpec) Read(format string, metadata_ DataMetadata, r io.Reader) (data interface{}, err error)
- func (s GeoImageDataSpec) ReadStream(r io.Reader) (interface{}, error)
- func (s GeoImageDataSpec) Write(data interface{}, format string, metadata_ DataMetadata, w io.Writer) error
- func (s GeoImageDataSpec) WriteStream(data interface{}, w io.Writer) error
- type GeoImageItemSource
- type GeoImageMetadata
- type GeoJsonData
- type GeoJsonDataSpec
- func (s GeoJsonDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s GeoJsonDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s GeoJsonDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (interface{}, error)
- func (s GeoJsonDataSpec) ReadStream(r io.Reader) (interface{}, error)
- func (s GeoJsonDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
- func (s GeoJsonDataSpec) WriteStream(data interface{}, w io.Writer) error
- type GraphID
- type Image
- func ImageFromBytes(width int, height int, bytes []byte) Image
- func ImageFromFile(fname string) (Image, error)
- func ImageFromGoImage(im image.Image) Image
- func ImageFromJPGReader(rd io.Reader) (Image, error)
- func ImageFromPNGReader(rd io.Reader) (Image, error)
- func NewImage(width int, height int) Image
- func (im Image) AsImage() image.Image
- func (im Image) AsJPG() ([]byte, error)
- func (im Image) AsPNG() ([]byte, error)
- func (im Image) At(i int, j int) color.Color
- func (im Image) Bounds() image.Rectangle
- func (im Image) ColorModel() color.Model
- func (im Image) Copy() Image
- func (im Image) Crop(sx, sy, ex, ey int) Image
- func (im Image) DrawImage(left int, top int, other Image)
- func (im Image) DrawLine(sx, sy, ex, ey int, width int, color [3]uint8)
- func (im Image) DrawRectangle(left, top, right, bottom int, width int, color [3]uint8)
- func (im Image) DrawText(text RichText)
- func (im Image) FillRectangle(left, top, right, bottom int, color [3]uint8)
- func (im Image) GetRGB(i int, j int) [3]uint8
- func (im Image) Resize(width int, height int) Image
- func (im Image) Set(i int, j int, c color.Color)
- func (im Image) SetRGB(i int, j int, color [3]uint8)
- func (im Image) ToBytes() []byte
- type ImageDataSpec
- func (s ImageDataSpec) Append(data interface{}, more interface{}) interface{}
- func (s ImageDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s ImageDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s ImageDataSpec) GetExtFromFormat(format string) (ext string)
- func (s ImageDataSpec) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
- func (s ImageDataSpec) Length(data interface{}) int
- func (s ImageDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func (s ImageDataSpec) ReadStream(r io.Reader) (interface{}, error)
- func (s ImageDataSpec) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
- func (s ImageDataSpec) Slice(data interface{}, i int, j int) interface{}
- func (s ImageDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
- func (s ImageDataSpec) WriteStream(data interface{}, w io.Writer) error
- func (s ImageDataSpec) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
- type ImageStreamHeader
- type IntJsonSpec
- func (s IntJsonSpec) Append(data interface{}, more interface{}) interface{}
- func (s IntJsonSpec) DecodeData(bytes []byte) (interface{}, error)
- func (s IntJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s IntJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
- func (s IntJsonSpec) Length(data interface{}) int
- func (s IntJsonSpec) Slice(data interface{}, i int, j int) interface{}
- type IntMetadata
- type Item
- func (item Item) CopyTo(fname string, format string, symlink bool) error
- func (item Item) DataSpec() DataSpec
- func (item Item) DecodeMetadata() DataMetadata
- func (item Item) Fname() string
- func (item Item) GetProvider() ItemProvider
- func (item Item) LoadData() (interface{}, DataMetadata, error)
- func (item Item) LoadReader() (SequenceReader, DataMetadata)
- func (item Item) LoadWriter() SequenceWriter
- func (item Item) Remove()
- func (item Item) UpdateData(data interface{}, metadata DataMetadata) error
- type ItemProvider
- type Job
- type JobOp
- type JobUpdate
- type MakeVideoOptions
- type MetadataFromFileDataSpec
- type ModelJobState
- type NoMetadata
- type Node
- type PDDImageOptions
- type PDDParams
- type PIInputOption
- type PIOutputDataset
- type PRestore
- type PTDParams
- type PytorchArch
- type PytorchArchComponent
- type PytorchArchInput
- type PytorchArchLoss
- type PytorchArchParams
- type PytorchComponent
- type PytorchComponentParams
- type PytorchInferParams
- type PytorchOpParams
- type PytorchRepository
- type PytorchTrainParams
- type RandomAccessDataSpec
- type ReadFfmpegOptions
- type RichText
- type Runnable
- type SequenceDataSpec
- type SequenceJsonDataImpl
- func (s SequenceJsonDataImpl) Append(data interface{}, more interface{}) interface{}
- func (s SequenceJsonDataImpl) DecodeMetadata(rawMetadata string) DataMetadata
- func (s SequenceJsonDataImpl) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s SequenceJsonDataImpl) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
- func (s SequenceJsonDataImpl) Length(data interface{}) int
- func (s SequenceJsonDataImpl) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func (s SequenceJsonDataImpl) ReadStream(r io.Reader) (data interface{}, err error)
- func (s SequenceJsonDataImpl) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
- func (s SequenceJsonDataImpl) Slice(data interface{}, i int, j int) interface{}
- func (s SequenceJsonDataImpl) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
- func (s SequenceJsonDataImpl) WriteStream(data interface{}, w io.Writer) error
- func (s SequenceJsonDataImpl) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
- type SequenceJsonSpec
- type SequenceReader
- type SequenceWriter
- type Shape
- type ShapeJsonSpec
- func (s ShapeJsonSpec) Append(data interface{}, more interface{}) interface{}
- func (s ShapeJsonSpec) DecodeData(bytes []byte) (interface{}, error)
- func (s ShapeJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s ShapeJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
- func (s ShapeJsonSpec) Length(data interface{}) int
- func (s ShapeJsonSpec) Slice(data interface{}, i int, j int) interface{}
- type ShapeMetadata
- type SimpleExecOp
- type SliceReader
- type SliceWriter
- type StatusRequest
- type StatusResponse
- type StringJsonSpec
- func (s StringJsonSpec) Append(data interface{}, more interface{}) interface{}
- func (s StringJsonSpec) DecodeData(bytes []byte) (interface{}, error)
- func (s StringJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s StringJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
- func (s StringJsonSpec) Length(data interface{}) int
- func (s StringJsonSpec) Slice(data interface{}, i int, j int) interface{}
- type TableData
- type TableDataSpec
- func (s TableDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s TableDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s TableDataSpec) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
- func (s TableDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func (s TableDataSpec) ReadStream(r io.Reader) (interface{}, error)
- func (s TableDataSpec) Write(data interface{}, format string, metadata_ DataMetadata, w io.Writer) error
- func (d TableDataSpec) WriteSQLFile(data TableData, metadata TableMetadata, fname string) error
- func (s TableDataSpec) WriteStream(data interface{}, w io.Writer) error
- type TableMetadata
- type TailJobOp
- type TypeOfShape
- type VideoBuilder
- type VideoDataSpec
- func (s VideoDataSpec) Append(data interface{}, more interface{}) interface{}
- func (s VideoDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
- func (s VideoDataSpec) FileReader(format string, metadata DataMetadata, fname string) SequenceReader
- func (s VideoDataSpec) FileWriter(format string, metadata DataMetadata, fname string) SequenceWriter
- func (s VideoDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
- func (s VideoDataSpec) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
- func (s VideoDataSpec) Length(data interface{}) int
- func (s VideoDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
- func (s VideoDataSpec) ReadSlice(format string, metadata DataMetadata, fname string, i, j int) SequenceReader
- func (s VideoDataSpec) ReadStream(r io.Reader) (data interface{}, err error)
- func (s VideoDataSpec) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
- func (s VideoDataSpec) Slice(data interface{}, i int, j int) interface{}
- func (s VideoDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
- func (s VideoDataSpec) WriteStream(data interface{}, w io.Writer) error
- func (s VideoDataSpec) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
- type VideoIterator
- type VideoMetadata
- type VideoReader
- type VideoStreamHeader
- type VirtualNode
- func (node VirtualNode) GetInputTypes() map[string][]DataType
- func (node VirtualNode) GetInputs() []ExecInput
- func (node VirtualNode) GetOp() ExecOpProvider
- func (node VirtualNode) GetOutputs() []ExecOutput
- func (node VirtualNode) GetRunnable(inputDatasets map[string][]Dataset, outputDatasets map[string]Dataset) Runnable
- func (node VirtualNode) GraphID() GraphID
- func (node VirtualNode) GraphParents() map[string]GraphID
- func (node VirtualNode) LocalHash() []byte
- type VirtualParent
Constants ¶
const ( ImageType DataType = "image" VideoType = "video" DetectionType = "detection" ShapeType = "shape" IntType = "int" FloatsType = "floats" ImListType = "imlist" TextType = "text" StringType = "string" ArrayType = "array" FileType = "file" TableType = "table" GeoImageType = "geoimage" GeoJsonType = "geojson" )
const ( PointShape TypeOfShape = "point" LineShape = "line" PolyLineShape = "polyline" BoxShape = "box" PolygonShape = "polygon" )
const Debug bool = false
const TailJobOpNumLines int = 1000
JobOp implementation that just keeps the latest 1000 lines of output This is used as a helper not as an actual JobOp -- since it can't stop the job. It is not thread-safe.
Variables ¶
var DataSpecs = make(map[DataType]DataSpec)
var DataTypes = map[DataType]string{ ImageType: "Image", VideoType: "Video", DetectionType: "Detection", ShapeType: "Shape", IntType: "Int", FloatsType: "Floats", ImListType: "Image List", TextType: "Text", StringType: "String", ArrayType: "Array", FileType: "File", TableType: "Table", GeoImageType: "Geo-Image", GeoJsonType: "GeoJSON", }
var ExecOpProviders = make(map[string]ExecOpProvider)
var ItemProviders = make(map[string]ItemProvider)
Functions ¶
func AddExecOpImpl ¶
func AddExecOpImpl(impl ExecOpImpl)
func DecodeFile ¶
func DecodeFile(t DataType, format string, metadata DataMetadata, fname string) (data interface{}, err error)
func DrawLineOnCells ¶
Use Bresenham's algorithm to get indices of cells to draw a line.
func EncodeTypes ¶
func FileExists ¶
func FloorDiv ¶
Returns a/b while taking floor (round-down) instead of truncating (round-towards-zero).
func GetExtFromFormat ¶
Forwards to ExtFromFormatDataSpec.GetExtFromFormat if available.
func GetGeometryBbox ¶
func GetGeometryBbox(g *geojson.Geometry) gomapinfer.Rectangle
func GetImageDimsFromFile ¶
func JsonMarshal ¶
func JsonMarshal(x interface{}) []byte
func JsonPostForm ¶
func JsonResponse ¶
func JsonResponse(w http.ResponseWriter, x interface{})
func JsonUnmarshal ¶
func JsonUnmarshal(bytes []byte, x interface{})
func ParseFloat ¶
func ParseJsonRequest ¶
func ParseJsonRequest(w http.ResponseWriter, r *http.Request, x interface{}) error
func ParseJsonResponse ¶
func ReadJSONFile ¶
func ReadJSONFile(fname string, res interface{})
func ReadJsonData ¶
Reads data that was written by WriteJsonData.
func ReadTextFile ¶
func SynchronizedReader ¶
func SynchronizedReader(items []Item, n int, f func(pos int, length int, datas []interface{}) error) error
Read multiple sequence-type datas in a synchronized fashion, in chunks of length [n]. [f] is a callback to pass each chunk of data to.
func TrySynchronizedReader ¶
func TrySynchronizedReader(items []Item, n int, f func(pos int, length int, datas []interface{}) error) error
Read multiple datas and try to break them up into chunks of length n. If there are any non-sequence-type datas, then we pass all the datas to the callback in one call. In that case, the length passed to the call is -1.
func WriteJsonData ¶
Write x with JSON-encoding to a stream. Before writing the JSON-encoded data, we write the length of the data.
Types ¶
type AnnotateDataset ¶
type AnnotateDataset struct { ID int Dataset Dataset Inputs []ExecParent Tool string Params string }
type ArrayDataSpec ¶
type ArrayDataSpec struct{}
func (ArrayDataSpec) Append ¶
func (s ArrayDataSpec) Append(data interface{}, more interface{}) interface{}
func (ArrayDataSpec) DecodeMetadata ¶
func (s ArrayDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (ArrayDataSpec) GetDefaultExtAndFormat ¶
func (s ArrayDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (ArrayDataSpec) Length ¶
func (s ArrayDataSpec) Length(data interface{}) int
func (ArrayDataSpec) Read ¶
func (s ArrayDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
func (ArrayDataSpec) ReadStream ¶
func (s ArrayDataSpec) ReadStream(r io.Reader) (interface{}, error)
func (ArrayDataSpec) Reader ¶
func (s ArrayDataSpec) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
func (ArrayDataSpec) Slice ¶
func (s ArrayDataSpec) Slice(data interface{}, i int, j int) interface{}
func (ArrayDataSpec) Write ¶
func (s ArrayDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
func (ArrayDataSpec) WriteStream ¶
func (s ArrayDataSpec) WriteStream(data interface{}, w io.Writer) error
func (ArrayDataSpec) Writer ¶
func (s ArrayDataSpec) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
type ArrayMetadata ¶
type ArrayMetadata struct { Width int `json:",omitempty"` Height int `json:",omitempty"` Channels int `json:",omitempty"` // uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64 Type string `json:",omitempty"` }
func (ArrayMetadata) BytesPerElement ¶
func (m ArrayMetadata) BytesPerElement() int
func (ArrayMetadata) Update ¶
func (m ArrayMetadata) Update(other DataMetadata) DataMetadata
type ArrayReader ¶
type ArrayReader struct {
// contains filtered or unexported fields
}
func (ArrayReader) Close ¶
func (r ArrayReader) Close()
func (ArrayReader) Read ¶
func (r ArrayReader) Read(n int) (interface{}, error)
type ArrayStreamHeader ¶
type ArrayWriter ¶
type ArrayWriter struct {
// contains filtered or unexported fields
}
func (ArrayWriter) Close ¶
func (w ArrayWriter) Close() error
func (ArrayWriter) Write ¶
func (w ArrayWriter) Write(data interface{}) error
type ChanReader ¶
type ChanReader struct {
Ch chan Image
}
func (*ChanReader) Close ¶
func (rd *ChanReader) Close()
func (*ChanReader) Read ¶
func (rd *ChanReader) Read() (Image, error)
type ClosingSequenceReader ¶
type ClosingSequenceReader struct { ReadCloser io.ReadCloser Reader SequenceReader }
SequenceReader that closes an io.ReadCloser on Close.
func (ClosingSequenceReader) Close ¶
func (r ClosingSequenceReader) Close()
func (ClosingSequenceReader) Read ¶
func (r ClosingSequenceReader) Read(n int) (interface{}, error)
type ClosingSequenceWriter ¶
type ClosingSequenceWriter struct { WriteCloser io.WriteCloser Writer SequenceWriter }
SequenceWriter that closses an io.WriteCloser on Close.
func (ClosingSequenceWriter) Close ¶
func (w ClosingSequenceWriter) Close() error
func (ClosingSequenceWriter) Write ¶
func (w ClosingSequenceWriter) Write(data interface{}) error
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
func Command ¶
func Command(prefix string, opts CommandOptions, command string, args ...string) *Cmd
func MakeVideo ¶
func MakeVideo(rd VideoReader, dims [2]int, rate [2]int, opts MakeVideoOptions) *Cmd
func (*Cmd) Stderr ¶
func (cmd *Cmd) Stderr() io.ReadCloser
func (*Cmd) Stdin ¶
func (cmd *Cmd) Stdin() io.WriteCloser
func (*Cmd) Stdout ¶
func (cmd *Cmd) Stdout() io.ReadCloser
type ColumnSpec ¶
type CommandOptions ¶
type CommandOptions struct { NoStdin bool NoStdout bool NoStderr bool NoPrintStderr bool // Function to arbitrary modify the exec.Cmd, e.g., set working directory. // This is called just before starting the process. F func(*exec.Cmd) // Whether to only print stderr if debug mode is on. OnlyDebug bool // Whether to keep not just the last stderr line, but all lines, in case of error. AllStderrLines bool }
type ContainerRequest ¶
coordinator->worker request creation of a new container
type ContainerResponse ¶
type ContainerResponse struct { // request/container UUID UUID string }
type DataMetadata ¶
type DataMetadata interface { // Produce new metadata where fields that are specified by other overwrite // fields in the current metadata. Update(other DataMetadata) DataMetadata }
Metadata can mostly be anything but must support Update.
type DataSpec ¶
type DataSpec interface { // Decode JSON-encoded metadata into a metadata object. DecodeMetadata(rawMetadata string) DataMetadata // Read data that has been written via WriteStream. ReadStream(r io.Reader) (data interface{}, err error) // Write data for reading via ReadStream. WriteStream(data interface{}, w io.Writer) error // Read data from storage. // format is the Item.Format which data types can use to describe how the data is stored. Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error) // Write data to storage. Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error // Given some data, return a suggested file extension and format to store it with. GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string) }
Specifies a data type.
type Dataset ¶
type Dataset struct { ID int Name string // data or computed Type string DataType DataType Metadata string // nil unless Type=computed Hash *string }
func (Dataset) GraphParents ¶
type Detection ¶
type Detection struct { Left int Top int Right int Bottom int // Optional metadata Category string `json:",omitempty"` TrackID int `json:",omitempty"` Score float64 `json:",omitempty"` Metadata map[string]string `json:",omitempty"` }
func (Detection) CenterDistance ¶
type DetectionJsonSpec ¶
type DetectionJsonSpec struct{}
func (DetectionJsonSpec) Append ¶
func (s DetectionJsonSpec) Append(data interface{}, more interface{}) interface{}
func (DetectionJsonSpec) DecodeData ¶
func (s DetectionJsonSpec) DecodeData(bytes []byte) (interface{}, error)
func (DetectionJsonSpec) DecodeMetadata ¶
func (s DetectionJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (DetectionJsonSpec) GetEmptyMetadata ¶
func (s DetectionJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
func (DetectionJsonSpec) Length ¶
func (s DetectionJsonSpec) Length(data interface{}) int
func (DetectionJsonSpec) Slice ¶
func (s DetectionJsonSpec) Slice(data interface{}, i int, j int) interface{}
type DetectionMetadata ¶
type DetectionMetadata struct { CanvasDims [2]int `json:",omitempty"` Categories []string `json:",omitempty"` }
func (DetectionMetadata) Update ¶
func (m DetectionMetadata) Update(other DataMetadata) DataMetadata
type ErrorSequenceReader ¶
type ErrorSequenceReader struct {
Error error
}
SequenceReader/SequenceWriter that return errors.
func (ErrorSequenceReader) Close ¶
func (r ErrorSequenceReader) Close()
func (ErrorSequenceReader) Read ¶
func (r ErrorSequenceReader) Read(n int) (interface{}, error)
type ErrorSequenceWriter ¶
type ErrorSequenceWriter struct {
Error error
}
func (ErrorSequenceWriter) Close ¶
func (w ErrorSequenceWriter) Close() error
func (ErrorSequenceWriter) Write ¶
func (w ErrorSequenceWriter) Write(data interface{}) error
type ExecBeginRequest ¶
worker->container
type ExecBeginResponse ¶
type ExecBeginResponse struct {
Parallelism int
}
type ExecNode ¶
type ExecNode struct { ID int Name string Op string Params string // currently configured parents for each input Parents map[string][]ExecParent }
func (ExecNode) GetInputTypes ¶
func (ExecNode) GetOp ¶
func (node ExecNode) GetOp() ExecOpProvider
func (ExecNode) GetOutputTypes ¶
func (ExecNode) GetOutputs ¶
func (node ExecNode) GetOutputs() []ExecOutput
type ExecOpConfig ¶
Config of the ExecOp for front-end.
type ExecOpImpl ¶
type ExecOpImpl struct { Config ExecOpConfig Requirements func(node Runnable) map[string]int GetTasks func(node Runnable, items map[string][][]Item) ([]ExecTask, error) Prepare func(url string, node Runnable) (ExecOp, error) // only one should be set (static/dynamic) ImageName string GetImageName func(node Runnable) (string, error) // static specification of inputs/outputs // one of dynamic/static should be set Inputs []ExecInput Outputs []ExecOutput // dynamic specification of inputs/outputs // one of dynamic/static should be set GetInputs func(params string) []ExecInput GetOutputs func(params string, inputTypes map[string][]DataType) []ExecOutput // optional; if set, op is considered "incremental" Incremental bool GetOutputKeys func(node ExecNode, inputs map[string][][]string) []string GetNeededInputs func(node ExecNode, outputs []string) map[string][][]string // more various optional functions GetJobOp func(node Runnable) (JobOp, string) Virtualize func(node ExecNode) *VirtualNode Resolve func(node *VirtualNode, inputDatasets map[string][]Dataset, items map[string][][]Item) ExecutionGraph }
A helper to implement an ExecOpProvider as a struct. This way optional methods can be omitted and defaults used instead. It can be compiled to an ExecOpProvider by wrapping in an ExecOpImplProvider.
type ExecOpImplProvider ¶
type ExecOpImplProvider struct {
Impl ExecOpImpl
}
func (ExecOpImplProvider) Config ¶
func (p ExecOpImplProvider) Config() ExecOpConfig
func (ExecOpImplProvider) GetImageName ¶
func (p ExecOpImplProvider) GetImageName(node Runnable) (string, error)
func (ExecOpImplProvider) GetInputs ¶
func (p ExecOpImplProvider) GetInputs(params string) []ExecInput
func (ExecOpImplProvider) GetJobOp ¶
func (p ExecOpImplProvider) GetJobOp(node Runnable) (JobOp, string)
func (ExecOpImplProvider) GetNeededInputs ¶
func (p ExecOpImplProvider) GetNeededInputs(node ExecNode, outputs []string) map[string][][]string
func (ExecOpImplProvider) GetOutputKeys ¶
func (p ExecOpImplProvider) GetOutputKeys(node ExecNode, inputs map[string][][]string) []string
func (ExecOpImplProvider) GetOutputs ¶
func (p ExecOpImplProvider) GetOutputs(params string, inputTypes map[string][]DataType) []ExecOutput
func (ExecOpImplProvider) IsIncremental ¶
func (p ExecOpImplProvider) IsIncremental() bool
func (ExecOpImplProvider) Prepare ¶
func (p ExecOpImplProvider) Prepare(url string, node Runnable) (ExecOp, error)
func (ExecOpImplProvider) Requirements ¶
func (p ExecOpImplProvider) Requirements(node Runnable) map[string]int
func (ExecOpImplProvider) Resolve ¶
func (p ExecOpImplProvider) Resolve(node *VirtualNode, inputDatasets map[string][]Dataset, items map[string][][]Item) ExecutionGraph
func (ExecOpImplProvider) Virtualize ¶
func (p ExecOpImplProvider) Virtualize(node ExecNode) *VirtualNode
type ExecOpProvider ¶
type ExecOpProvider interface { // Returns config for front-end. Config() ExecOpConfig // Returns resource requirements. Requirements(node Runnable) map[string]int // Returns list of tasks. // items: is a map: input name -> input dataset index -> items in that dataset GetTasks(node Runnable, items map[string][][]Item) ([]ExecTask, error) // Prepare the ExecOp for a node. Prepare(url string, node Runnable) (ExecOp, error) // Determines the input specification of a node. GetInputs(params string) []ExecInput // Determines the output specification of a node. GetOutputs(params string, inputTypes map[string][]DataType) []ExecOutput // Incremental ops support partial computation of their outputs. // This is only possible for concrete nodes (Resolve must return nil). IsIncremental() bool // Must be implemented if Incremental. // GetOutputKeys returns all output keys that would be produced given a set of input keys. // GetNeededInputs returns the input keys that are needed to compute a given subset of output keys. GetOutputKeys(node ExecNode, inputs map[string][][]string) []string GetNeededInputs(node ExecNode, outputs []string) map[string][][]string // Docker image name GetImageName(node Runnable) (string, error) // Optional system to provide customized state to store in ExecNode jobs. // For example, when training a model, we may want to store the loss history. // Can return nil to use defaults. // Second return value is the view of the JobOp, empty string to use default view. GetJobOp(node Runnable) (JobOp, string) // Virtualize is called when constructing an initial ExecutionGraph. // For example, if(A) { input B } else { input C } can be implemented by: // - Virtualize should return VirtualNode requiring only A // - Resolve can load A, and output a new graph that includes B or C depending on A Virtualize(node ExecNode) *VirtualNode // Optional system for pre-processing steps, dynamic execution graphs, etc. // Given a VirtualNode, returns a subgraph of new VirtualNodes that implement it. // Or nil if the VirtualNode is already OK. // Resolve is called just before executing the node. Resolve(node *VirtualNode, inputDatasets map[string][]Dataset, items map[string][][]Item) ExecutionGraph }
func GetExecOp ¶
func GetExecOp(opName string) ExecOpProvider
type ExecOutput ¶
type ExecParent ¶
type ExecParent struct { // "n" for ExecNode, "d" for Dataset Type string ID int // name of ExecNode output that is being input Name string // the data type of this parent DataType DataType }
func (ExecParent) String ¶
func (p ExecParent) String() string
type ExecTask ¶
type ExecTask struct { // For incremental operations, this must be the output key that will be created by this task. // TODO: operation may need to produce multiple output keys at some task // For other operations, I think this can be arbitrary, but usually it's still related to the output key Key string // Generally maps from input name to list of items in each dataset at that input Items map[string][][]Item Metadata string }
type ExecutionGraph ¶
An execption graph, that maps GraphIDs to Nodes.
func (ExecutionGraph) GetHashStrings ¶
func (graph ExecutionGraph) GetHashStrings() map[GraphID]string
func (ExecutionGraph) GetHashes ¶
func (graph ExecutionGraph) GetHashes() map[GraphID][]byte
Returns hashes of all nodes in the graph.
type ExtFromFormatDataSpec ¶
type FfmpegReader ¶
func ReadFfmpeg ¶
func ReadFfmpeg(fname string, dims [2]int, rate [2]int, opts ReadFfmpegOptions) *FfmpegReader
func (*FfmpegReader) Close ¶
func (rd *FfmpegReader) Close()
func (*FfmpegReader) Read ¶
func (rd *FfmpegReader) Read() (Image, error)
type FileDataSpec ¶
type FileDataSpec interface { DataSpec // Read data directly from a file. ReadFile(format string, metadata DataMetadata, fname string) (data interface{}, err error) // Write data directly to a file. WriteFile(data interface{}, format string, metadata DataMetadata, fname string) error }
type FileMetadata ¶
type FileMetadata struct {
Filename string `json:",omitempty"`
}
func (FileMetadata) Update ¶
func (m FileMetadata) Update(other DataMetadata) DataMetadata
type FileSequenceDataSpec ¶
type FileSequenceDataSpec interface { SequenceDataSpec FileReader(format string, metadata DataMetadata, fname string) SequenceReader FileWriter(format string, metadata DataMetadata, fname string) SequenceWriter }
Sequence data types that want to have special functionality when reading from local disk can implement FileReader and FileWriter.
type FileStreamHeader ¶
type FileStreamHeader struct {
Length int
}
type FileTypeDataSpec ¶
type FileTypeDataSpec struct{}
func (FileTypeDataSpec) DecodeMetadata ¶
func (s FileTypeDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (FileTypeDataSpec) GetDefaultExtAndFormat ¶
func (s FileTypeDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (FileTypeDataSpec) Read ¶
func (s FileTypeDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
func (FileTypeDataSpec) ReadStream ¶
func (s FileTypeDataSpec) ReadStream(r io.Reader) (interface{}, error)
func (FileTypeDataSpec) Write ¶
func (s FileTypeDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
func (FileTypeDataSpec) WriteStream ¶
func (s FileTypeDataSpec) WriteStream(data interface{}, w io.Writer) error
type FloatJsonSpec ¶
type FloatJsonSpec struct{}
func (FloatJsonSpec) Append ¶
func (s FloatJsonSpec) Append(data interface{}, more interface{}) interface{}
func (FloatJsonSpec) DecodeData ¶
func (s FloatJsonSpec) DecodeData(bytes []byte) (interface{}, error)
func (FloatJsonSpec) DecodeMetadata ¶
func (s FloatJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (FloatJsonSpec) GetEmptyMetadata ¶
func (s FloatJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
func (FloatJsonSpec) Length ¶
func (s FloatJsonSpec) Length(data interface{}) int
func (FloatJsonSpec) Slice ¶
func (s FloatJsonSpec) Slice(data interface{}, i int, j int) interface{}
type GeoBbox ¶
type GeoBbox [4]float64
func (GeoBbox) Rect ¶
func (bbox GeoBbox) Rect() gomapinfer.Rectangle
type GeoImageDataSpec ¶
type GeoImageDataSpec struct{}
func (GeoImageDataSpec) DecodeMetadata ¶
func (s GeoImageDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (GeoImageDataSpec) GetDefaultExtAndFormat ¶
func (s GeoImageDataSpec) GetDefaultExtAndFormat(data interface{}, metadata_ DataMetadata) (ext string, format string)
func (GeoImageDataSpec) Read ¶
func (s GeoImageDataSpec) Read(format string, metadata_ DataMetadata, r io.Reader) (data interface{}, err error)
func (GeoImageDataSpec) ReadStream ¶
func (s GeoImageDataSpec) ReadStream(r io.Reader) (interface{}, error)
func (GeoImageDataSpec) Write ¶
func (s GeoImageDataSpec) Write(data interface{}, format string, metadata_ DataMetadata, w io.Writer) error
func (GeoImageDataSpec) WriteStream ¶
func (s GeoImageDataSpec) WriteStream(data interface{}, w io.Writer) error
type GeoImageItemSource ¶
type GeoImageMetadata ¶
type GeoImageMetadata struct { // either "webmercator" or "custom" ReferenceType string `json:",omitempty"` // For "webmercator" georeference type. // Zoom, X, and Y specify the cell that the image spans. Zoom int `json:",omitempty"` X int `json:",omitempty"` Y int `json:",omitempty"` // Scale specifies resolution of each cell. Usually it is 256. Scale int `json:",omitempty"` // Offset specifies offset from the X,Y tile. Offset [2]int `json:",omitempty"` // Width and height corresponding to the specified zoom and scale. // This does not necessarily match the image width and height, but if image // is resized from this width and height then the x / y axis must still be proportional. Width int `json:",omitempty"` Height int `json:",omitempty"` // For custom formats, optionally store the longitude-latitude of bottom-left and top-right corners. // If set, we assume that the projection is like Mercator where compass direction matches image axes. // If not set, we cannot transform between longitude-latitude and pixel coordinates. Bbox [4]float64 `json:",omitempty"` // image source type // "local": image is stored in JPEG file // "url": image comes from a tile server // "dataset": image comes from another dataset SourceType string `json:",omitempty"` // For URL type, the tile server URL. URL string `json:",omitempty"` // For dataset type, define the source items. Items []GeoImageItemSource `json:",omitempty"` }
func (GeoImageMetadata) DownloadTile ¶
func (m GeoImageMetadata) DownloadTile(i, j int) (Image, error)
Assuming SourceType=="url", download a tile in this image from the URL.
func (GeoImageMetadata) GetBbox ¶
func (m GeoImageMetadata) GetBbox() GeoBbox
Get the bounding box of this image.
func (GeoImageMetadata) Update ¶
func (m GeoImageMetadata) Update(other DataMetadata) DataMetadata
type GeoJsonData ¶
type GeoJsonData struct {
Collection *geojson.FeatureCollection
}
type GeoJsonDataSpec ¶
type GeoJsonDataSpec struct{}
func (GeoJsonDataSpec) DecodeMetadata ¶
func (s GeoJsonDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (GeoJsonDataSpec) GetDefaultExtAndFormat ¶
func (s GeoJsonDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (GeoJsonDataSpec) Read ¶
func (s GeoJsonDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (interface{}, error)
func (GeoJsonDataSpec) ReadStream ¶
func (s GeoJsonDataSpec) ReadStream(r io.Reader) (interface{}, error)
func (GeoJsonDataSpec) Write ¶
func (s GeoJsonDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
func (GeoJsonDataSpec) WriteStream ¶
func (s GeoJsonDataSpec) WriteStream(data interface{}, w io.Writer) error
type GraphID ¶
type GraphID struct { // Either "exec" or "dataset" Type string // ID of ExecNode or Dataset ID int // For virtual nodes, some unique key for it VirtualKey string }
ID type in execution graph.
type Image ¶
func ImageFromFile ¶
func ImageFromGoImage ¶
func (Image) ColorModel ¶
func (Image) DrawRectangle ¶
func (Image) FillRectangle ¶
type ImageDataSpec ¶
type ImageDataSpec struct{}
func (ImageDataSpec) Append ¶
func (s ImageDataSpec) Append(data interface{}, more interface{}) interface{}
func (ImageDataSpec) DecodeMetadata ¶
func (s ImageDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (ImageDataSpec) GetDefaultExtAndFormat ¶
func (s ImageDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (ImageDataSpec) GetExtFromFormat ¶
func (s ImageDataSpec) GetExtFromFormat(format string) (ext string)
func (ImageDataSpec) GetMetadataFromFile ¶
func (s ImageDataSpec) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
func (ImageDataSpec) Length ¶
func (s ImageDataSpec) Length(data interface{}) int
func (ImageDataSpec) Read ¶
func (s ImageDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
func (ImageDataSpec) ReadStream ¶
func (s ImageDataSpec) ReadStream(r io.Reader) (interface{}, error)
func (ImageDataSpec) Reader ¶
func (s ImageDataSpec) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
func (ImageDataSpec) Slice ¶
func (s ImageDataSpec) Slice(data interface{}, i int, j int) interface{}
func (ImageDataSpec) Write ¶
func (s ImageDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
func (ImageDataSpec) WriteStream ¶
func (s ImageDataSpec) WriteStream(data interface{}, w io.Writer) error
func (ImageDataSpec) Writer ¶
func (s ImageDataSpec) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
type ImageStreamHeader ¶
type IntJsonSpec ¶
type IntJsonSpec struct{}
func (IntJsonSpec) Append ¶
func (s IntJsonSpec) Append(data interface{}, more interface{}) interface{}
func (IntJsonSpec) DecodeData ¶
func (s IntJsonSpec) DecodeData(bytes []byte) (interface{}, error)
func (IntJsonSpec) DecodeMetadata ¶
func (s IntJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (IntJsonSpec) GetEmptyMetadata ¶
func (s IntJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
func (IntJsonSpec) Length ¶
func (s IntJsonSpec) Length(data interface{}) int
func (IntJsonSpec) Slice ¶
func (s IntJsonSpec) Slice(data interface{}, i int, j int) interface{}
type IntMetadata ¶
type IntMetadata struct {
Categories []string `json:",omitempty"`
}
func (IntMetadata) Update ¶
func (m IntMetadata) Update(other DataMetadata) DataMetadata
type Item ¶
type Item struct { Dataset Dataset Key string Ext string Format string Metadata string // nil to use default storage provider for LoadData / UpdateData Provider *string ProviderInfo *string }
func (Item) CopyTo ¶
Copy the data to the specified filename with specified output format. If symlink is true, we try to symlink when possible. In some cases, copying data isn't possible and we need to actually load it (decode+re-encode).
func (Item) DecodeMetadata ¶
func (item Item) DecodeMetadata() DataMetadata
func (Item) GetProvider ¶
func (item Item) GetProvider() ItemProvider
func (Item) LoadData ¶
func (item Item) LoadData() (interface{}, DataMetadata, error)
func (Item) LoadReader ¶
func (item Item) LoadReader() (SequenceReader, DataMetadata)
func (Item) LoadWriter ¶
func (item Item) LoadWriter() SequenceWriter
func (Item) UpdateData ¶
func (item Item) UpdateData(data interface{}, metadata DataMetadata) error
type ItemProvider ¶
type ItemProvider struct { LoadData func(item Item) (interface{}, DataMetadata, error) // optional: we panic if UpdateData is called without being supported UpdateData func(item Item, data interface{}, metadata DataMetadata) error // optional: we return empty string if Fname is called without being supported // caller then needs to fallback to loading the data Fname func(item Item) string }
var DefaultItemProvider ItemProvider
func VirtualProvider ¶
func VirtualProvider(f func(item Item, data interface{}, metadata DataMetadata) (interface{}, DataMetadata, error), visibleFname bool) ItemProvider
helper function to create virtual item providers virtual providers reference another dataset, calling LoadData on the other dataset but then applying some function on the data before returning it in virtual providers, ProviderInfo is JSON-encoded item in other dataset TODO: but this means stack of virtual providers will make item metadata keep getting longer and longer...
type MakeVideoOptions ¶
type MetadataFromFileDataSpec ¶
type MetadataFromFileDataSpec interface { DataSpec // Given a filename, which should correspond to an actual file stored on disk, // returns a suitable format and metadata for reading that file. GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error) }
type ModelJobState ¶
type NoMetadata ¶
type NoMetadata struct{}
func (NoMetadata) Update ¶
func (m NoMetadata) Update(other DataMetadata) DataMetadata
type Node ¶
type Node interface { // Parents of this node. // These are other nodes that must be executed before this node can be executed. // Key defines what kind of parent it is. GraphParents() map[string]GraphID // The local hash at this node. // The hash of a node is computed by merging hash of its parents with its local hash. LocalHash() []byte // unique identifier GraphID() GraphID }
A node in an execution pipeline. This is either an execution node (VirtualNode) or a dataset (Dataset).
type PDDImageOptions ¶
Pytorch default dataset parameters. This configures skyhook.pytorch.dataset.default, and goes JSON-encoded in PytorchTrainParams.Dataset.Params.
type PIInputOption ¶
type PIOutputDataset ¶
type PTDParams ¶
type PTDParams struct { LearningRate float64 Optimizer string BatchSize int AutoBatchSize bool StopCondition struct { MaxEpochs int ScoreEpsilon float64 ScoreMaxEpochs int } ModelSaver struct { Mode string } RateDecay struct { Op string StepSize int StepGamma float64 PlateauFactor float64 PlateauPatience int PlateauThreshold float64 PlateauMin float64 } }
Pytorch default training loop parameters.
type PytorchArch ¶
type PytorchArch struct { ID string Params PytorchArchParams }
type PytorchArchComponent ¶
type PytorchArchComponent struct { // PytorchComponent ID ID string // arbitrary JSON parameters Params string // where should component.Inputs come from // these must be layer or input dataset (not target dataset) Inputs []PytorchArchInput // where should component.Targets come from // these could be layer, input dataset, or target dataset Targets []PytorchArchInput }
type PytorchArchInput ¶
type PytorchArchLoss ¶
type PytorchArchParams ¶
type PytorchArchParams struct { // datasets during training are numbered starting from inputs, then continuing with targets // DatasetIdx refer to this unified numbering scheme NumInputs int NumTargets int Components []PytorchArchComponent Losses []PytorchArchLoss Scores []PytorchArchLoss }
type PytorchComponent ¶
type PytorchComponent struct { ID string Params PytorchComponentParams }
type PytorchComponentParams ¶
type PytorchComponentParams struct { // the module can be defined one of three ways: // - a built-in module in exec_ops/pytorch/models/X.py // - a module X in a git repository Y // - hardcoded // only one of BuiltInModule, RepositoryModule, and Code should be set // if RepositoryModule is set, Repository must be as well Module struct { BuiltInModule string Repository PytorchRepository RepositoryModule string Code string } // inputs/targets are provided as arguments to forward pass NumInputs int NumTargets int // produces these recommended skyhook outputs Outputs map[string]DataType // forward pass output dict also includes these layers and losses Layers []string Losses []string Repositories []PytorchRepository }
type PytorchInferParams ¶
type PytorchInferParams struct { ArchID string InputOptions []PIInputOption OutputDatasets []PIOutputDataset // See PytorchTrainParams.Components Components map[int]string }
type PytorchOpParams ¶
type PytorchRepository ¶
type PytorchRepository struct { URL string // Optional (empty string for latest commit in default branch) Commit string }
A git repository that's used as a library in some component.
func (PytorchRepository) Hash ¶
func (repo PytorchRepository) Hash() string
type PytorchTrainParams ¶
type PytorchTrainParams struct { ArchID string // dataset options Dataset PytorchOpParams // data augmentation Augment []PytorchOpParams // restoring models, corresponding to the "models" input Restore []PRestore // training loop parameters Train PytorchOpParams // Configuring component parameters. // This is like PytorchArchComponent.Params, but just overrides or extends // those parameters with more options. // It is map from component index to JSON-encoded parameters. Components map[int]string }
type RandomAccessDataSpec ¶
type RandomAccessDataSpec interface { SequenceDataSpec // Initialize a SequenceReader that starts reading at index i, and reads up to index j. ReadSlice(format string, metadata DataMetadata, fname string, i, j int) SequenceReader }
type ReadFfmpegOptions ¶
type ReadFfmpegOptions struct { // The source of the encoded video data. // One of Fname or Reader must be set. Fname string Reader io.Reader // If non-zero, the offset in the file to seek to before reading. Start int // If non-zero, read only this many frames. Length int }
Read video file from fname with the given dimensions and framerate. Start and length specify a range of frame indexes to read, but can be 0 to read the entire file.
type Runnable ¶
type Runnable struct { Name string Op string Params string InputDatasets map[string][]Dataset OutputDatasets map[string]Dataset }
func (Runnable) GetOp ¶
func (node Runnable) GetOp() ExecOpProvider
type SequenceDataSpec ¶
type SequenceDataSpec interface { DataSpec // Initialize a SequenceReader for reading data from storage. // The SequenceReader should read the data chunk by chunk. Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader // Initialize a SequenceWriter to write chunk by chunk to storage. Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter // Slice operations on the sequence data. Length(data interface{}) int Append(data interface{}, more interface{}) interface{} Slice(data interface{}, i int, j int) interface{} }
SequenceDataSpec describes sequence data types. These are any data types consisting of a sequence of elements. For example, Detections are sequences of []Detection, while videos are sequences of images.
type SequenceJsonDataImpl ¶
type SequenceJsonDataImpl struct {
Spec SequenceJsonSpec
}
func (SequenceJsonDataImpl) Append ¶
func (s SequenceJsonDataImpl) Append(data interface{}, more interface{}) interface{}
func (SequenceJsonDataImpl) DecodeMetadata ¶
func (s SequenceJsonDataImpl) DecodeMetadata(rawMetadata string) DataMetadata
func (SequenceJsonDataImpl) GetDefaultExtAndFormat ¶
func (s SequenceJsonDataImpl) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (SequenceJsonDataImpl) GetMetadataFromFile ¶
func (s SequenceJsonDataImpl) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
func (SequenceJsonDataImpl) Length ¶
func (s SequenceJsonDataImpl) Length(data interface{}) int
func (SequenceJsonDataImpl) Read ¶
func (s SequenceJsonDataImpl) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
func (SequenceJsonDataImpl) ReadStream ¶
func (s SequenceJsonDataImpl) ReadStream(r io.Reader) (data interface{}, err error)
func (SequenceJsonDataImpl) Reader ¶
func (s SequenceJsonDataImpl) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
func (SequenceJsonDataImpl) Slice ¶
func (s SequenceJsonDataImpl) Slice(data interface{}, i int, j int) interface{}
func (SequenceJsonDataImpl) Write ¶
func (s SequenceJsonDataImpl) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
func (SequenceJsonDataImpl) WriteStream ¶
func (s SequenceJsonDataImpl) WriteStream(data interface{}, w io.Writer) error
func (SequenceJsonDataImpl) Writer ¶
func (s SequenceJsonDataImpl) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
type SequenceJsonSpec ¶
type SequenceJsonSpec interface { DecodeMetadata(rawMetadata string) DataMetadata DecodeData(bytes []byte) (interface{}, error) GetEmptyMetadata() (metadata DataMetadata) Length(data interface{}) int Append(data interface{}, more interface{}) interface{} Slice(data interface{}, i int, j int) interface{} }
Implement DataSpec using simple JSON-only format.
type SequenceReader ¶
func NewSliceReader ¶
func NewSliceReader(spec SequenceDataSpec, format string, metadata DataMetadata, r io.Reader) SequenceReader
type SequenceWriter ¶
type Shape ¶
type ShapeJsonSpec ¶
type ShapeJsonSpec struct{}
func (ShapeJsonSpec) Append ¶
func (s ShapeJsonSpec) Append(data interface{}, more interface{}) interface{}
func (ShapeJsonSpec) DecodeData ¶
func (s ShapeJsonSpec) DecodeData(bytes []byte) (interface{}, error)
func (ShapeJsonSpec) DecodeMetadata ¶
func (s ShapeJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (ShapeJsonSpec) GetEmptyMetadata ¶
func (s ShapeJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
func (ShapeJsonSpec) Length ¶
func (s ShapeJsonSpec) Length(data interface{}) int
func (ShapeJsonSpec) Slice ¶
func (s ShapeJsonSpec) Slice(data interface{}, i int, j int) interface{}
type ShapeMetadata ¶
type ShapeMetadata struct { CanvasDims [2]int `json:",omitempty"` Categories []string `json:",omitempty"` }
func (ShapeMetadata) Update ¶
func (m ShapeMetadata) Update(other DataMetadata) DataMetadata
type SimpleExecOp ¶
A wrapper for a simple exec op that needs no persistent state. So the wrapper just wraps a function, along with desired parallelism.
func (SimpleExecOp) Apply ¶
func (e SimpleExecOp) Apply(task ExecTask) error
func (SimpleExecOp) Close ¶
func (e SimpleExecOp) Close()
func (SimpleExecOp) Parallelism ¶
func (e SimpleExecOp) Parallelism() int
type SliceReader ¶
type SliceReader struct { Data interface{} Spec SequenceDataSpec // contains filtered or unexported fields }
SequenceReader for sequence data that has already been read into memory.
func (*SliceReader) Close ¶
func (r *SliceReader) Close()
func (*SliceReader) Read ¶
func (r *SliceReader) Read(n int) (interface{}, error)
type SliceWriter ¶
type SliceWriter struct { Spec SequenceDataSpec Format string Metadata DataMetadata Writer io.Writer // contains filtered or unexported fields }
SequenceWriter that stores everything in-memory until Close.
func (*SliceWriter) Close ¶
func (w *SliceWriter) Close() error
func (*SliceWriter) Write ¶
func (w *SliceWriter) Write(data interface{}) error
type StatusRequest ¶
type StatusRequest struct {
UUID string
}
coordinator->worker sent repeatedly to get status of the ContainerRequest
type StatusResponse ¶
type StatusResponse struct { // whether the container has been provisioned Ready bool // if not Ready, some message e.g. position in queue Message string // if Ready, forwarded ExecBeginResponse ExecBeginResponse ExecBeginResponse // if Ready, base URL where container can be accessed BaseURL string }
type StringJsonSpec ¶
type StringJsonSpec struct{}
func (StringJsonSpec) Append ¶
func (s StringJsonSpec) Append(data interface{}, more interface{}) interface{}
func (StringJsonSpec) DecodeData ¶
func (s StringJsonSpec) DecodeData(bytes []byte) (interface{}, error)
func (StringJsonSpec) DecodeMetadata ¶
func (s StringJsonSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (StringJsonSpec) GetEmptyMetadata ¶
func (s StringJsonSpec) GetEmptyMetadata() (metadata DataMetadata)
func (StringJsonSpec) Length ¶
func (s StringJsonSpec) Length(data interface{}) int
func (StringJsonSpec) Slice ¶
func (s StringJsonSpec) Slice(data interface{}, i int, j int) interface{}
type TableDataSpec ¶
type TableDataSpec struct{}
func (TableDataSpec) DecodeMetadata ¶
func (s TableDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (TableDataSpec) GetDefaultExtAndFormat ¶
func (s TableDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (TableDataSpec) GetMetadataFromFile ¶
func (s TableDataSpec) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
func (TableDataSpec) Read ¶
func (s TableDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
func (TableDataSpec) ReadStream ¶
func (s TableDataSpec) ReadStream(r io.Reader) (interface{}, error)
func (TableDataSpec) Write ¶
func (s TableDataSpec) Write(data interface{}, format string, metadata_ DataMetadata, w io.Writer) error
func (TableDataSpec) WriteSQLFile ¶
func (d TableDataSpec) WriteSQLFile(data TableData, metadata TableMetadata, fname string) error
func (TableDataSpec) WriteStream ¶
func (s TableDataSpec) WriteStream(data interface{}, w io.Writer) error
type TableMetadata ¶
type TableMetadata struct {
Columns []ColumnSpec `json:",omitempty"`
}
func (TableMetadata) Update ¶
func (m TableMetadata) Update(other DataMetadata) DataMetadata
type VideoBuilder ¶
type VideoBuilder struct { Metadata VideoMetadata Fname string Writer io.Writer // contains filtered or unexported fields }
func (*VideoBuilder) Close ¶
func (b *VideoBuilder) Close() error
func (*VideoBuilder) GetDuration ¶
func (b *VideoBuilder) GetDuration() float64
Get the duration of the written video. Must only be called after Close().
func (*VideoBuilder) Write ¶
func (b *VideoBuilder) Write(chunk interface{}) error
type VideoDataSpec ¶
type VideoDataSpec struct{}
func (VideoDataSpec) Append ¶
func (s VideoDataSpec) Append(data interface{}, more interface{}) interface{}
func (VideoDataSpec) DecodeMetadata ¶
func (s VideoDataSpec) DecodeMetadata(rawMetadata string) DataMetadata
func (VideoDataSpec) FileReader ¶
func (s VideoDataSpec) FileReader(format string, metadata DataMetadata, fname string) SequenceReader
func (VideoDataSpec) FileWriter ¶
func (s VideoDataSpec) FileWriter(format string, metadata DataMetadata, fname string) SequenceWriter
func (VideoDataSpec) GetDefaultExtAndFormat ¶
func (s VideoDataSpec) GetDefaultExtAndFormat(data interface{}, metadata DataMetadata) (ext string, format string)
func (VideoDataSpec) GetMetadataFromFile ¶
func (s VideoDataSpec) GetMetadataFromFile(fname string) (format string, metadata DataMetadata, err error)
Use ffprobe to get the resolution and duration of the video. Framerate currently defaults to 10 fps.
func (VideoDataSpec) Length ¶
func (s VideoDataSpec) Length(data interface{}) int
func (VideoDataSpec) Read ¶
func (s VideoDataSpec) Read(format string, metadata DataMetadata, r io.Reader) (data interface{}, err error)
func (VideoDataSpec) ReadSlice ¶
func (s VideoDataSpec) ReadSlice(format string, metadata DataMetadata, fname string, i, j int) SequenceReader
func (VideoDataSpec) ReadStream ¶
func (s VideoDataSpec) ReadStream(r io.Reader) (data interface{}, err error)
func (VideoDataSpec) Reader ¶
func (s VideoDataSpec) Reader(format string, metadata DataMetadata, r io.Reader) SequenceReader
func (VideoDataSpec) Slice ¶
func (s VideoDataSpec) Slice(data interface{}, i int, j int) interface{}
func (VideoDataSpec) Write ¶
func (s VideoDataSpec) Write(data interface{}, format string, metadata DataMetadata, w io.Writer) error
func (VideoDataSpec) WriteStream ¶
func (s VideoDataSpec) WriteStream(data interface{}, w io.Writer) error
func (VideoDataSpec) Writer ¶
func (s VideoDataSpec) Writer(format string, metadata DataMetadata, w io.Writer) SequenceWriter
type VideoIterator ¶
type VideoIterator struct { Metadata VideoMetadata Fname string Reader io.Reader // contains filtered or unexported fields }
VideoIterator duals as a SequenceReader for video.
func (*VideoIterator) Close ¶
func (it *VideoIterator) Close()
func (*VideoIterator) Read ¶
func (it *VideoIterator) Read(n int) (interface{}, error)
type VideoMetadata ¶
type VideoMetadata struct { // view settings that can be adjusted Dims [2]int `json:",omitempty"` Framerate [2]int `json:",omitempty"` // cached properties that don't make sense to adjust Duration float64 `json:",omitempty"` }
func (VideoMetadata) NumFrames ¶
func (m VideoMetadata) NumFrames() int
Approximate number of frames in this video.
func (VideoMetadata) Update ¶
func (m VideoMetadata) Update(other DataMetadata) DataMetadata
type VideoReader ¶
type VideoStreamHeader ¶
type VirtualNode ¶
type VirtualNode struct { // from ExecNode Name string Op string Params string // Parents of this node. Parents map[string][]VirtualParent // the concrete node that this ExecNode was created from // if ExecOpImpl.Resolve is not set, then Node == OrigNode OrigNode ExecNode // A unique identifier for this node if it is actually virtual (Node != OrigNode). VirtualKey string }
Like ExecNode, but knows its position in the dynamic execution graph. So it points to parent nodes/datasets with GraphIDs instead of database IDs. This is virtual because it may or may not be an actual configured node. (It may by created dynamically by ExecOpImpl.Resolve.)
func (VirtualNode) GetInputTypes ¶
func (node VirtualNode) GetInputTypes() map[string][]DataType
func (VirtualNode) GetInputs ¶
func (node VirtualNode) GetInputs() []ExecInput
func (VirtualNode) GetOp ¶
func (node VirtualNode) GetOp() ExecOpProvider
func (VirtualNode) GetOutputs ¶
func (node VirtualNode) GetOutputs() []ExecOutput
func (VirtualNode) GetRunnable ¶
func (VirtualNode) GraphID ¶
func (node VirtualNode) GraphID() GraphID
func (VirtualNode) GraphParents ¶
func (node VirtualNode) GraphParents() map[string]GraphID
func (VirtualNode) LocalHash ¶
func (node VirtualNode) LocalHash() []byte
type VirtualParent ¶
type VirtualParent struct { GraphID GraphID // if GraphID.Type is "exec", then this is name of output that we want to input Name string DataType DataType }
Like ExecParent but points to an actual Node.
Source Files ¶
- annotate.go
- bresenham.go
- data.go
- data_array.go
- data_detection.go
- data_file.go
- data_floats.go
- data_geoimage.go
- data_geojson.go
- data_image.go
- data_int.go
- data_json_types.go
- data_shape.go
- data_string.go
- data_synchronized_reader.go
- data_table.go
- data_video.go
- dataset.go
- exec.go
- exec_op.go
- ffmpeg.go
- graph.go
- image.go
- job.go
- pytorch.go
- util.go
- worker_api.go