Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func Download(ctx context.Context) error
- func DownloadFeatues(ctx context.Context) error
- func DownloadModels(ctx context.Context) error
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type ModelAssets
- type ModelManifest
- func (model ModelManifest) CanonicalName() (string, error)
- func (model ModelManifest) Download(ctx context.Context) (err error)
- func (model ModelManifest) GetFeaturesPath() string
- func (model ModelManifest) GetFeaturesUrl() string
- func (model ModelManifest) GetGraphPath() string
- func (model ModelManifest) GetGraphUrl() string
- func (model ModelManifest) GetImageDimensions() ([]uint32, error)
- func (model ModelManifest) GetMeanImage() ([]float32, error)
- func (model ModelManifest) GetWeightsPath() string
- func (model ModelManifest) GetWeightsUrl() string
- func (model ModelManifest) MustCanonicalName() string
- func (model ModelManifest) WorkDir() string
- type ModelManifest_Type
- type ModelManifests
Constants ¶
This section is empty.
Variables ¶
var ( Models = ModelManifests{} LargeModels = ModelManifests{} )
var (
Features = map[string]string{}
)
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func DownloadFeatues ¶
func DownloadModels ¶
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type ModelAssets ¶
type ModelAssets struct { BaseUrl string `protobuf:"bytes,1,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty" yaml:"base_url,omitempty"` WeightsPath string `protobuf:"bytes,2,opt,name=weights_path,json=weightsPath,proto3" json:"weights_path,omitempty" yaml:"weights_path,omitempty"` GraphPath string `protobuf:"bytes,3,opt,name=graph_path,json=graphPath,proto3" json:"graph_path,omitempty" yaml:"graph_path,omitempty"` }
type ModelManifest ¶
type ModelManifest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty" yaml:"version,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty" yaml:"description,omitempty"` Reference []string `protobuf:"bytes,6,rep,name=reference" json:"reference,omitempty" yaml:"references,omitempty"` License string `protobuf:"bytes,7,opt,name=license,proto3" json:"license,omitempty" yaml:"license,omitempty"` Inputs []*ModelManifest_Type `protobuf:"bytes,8,rep,name=inputs" json:"inputs,omitempty" yaml:"inputs,omitempty"` Output *ModelManifest_Type `protobuf:"bytes,9,opt,name=output" json:"output,omitempty" yaml:"output,omitempty"` BeforePreprocess string `` /* 145-byte string literal not displayed */ Preprocess string `protobuf:"bytes,11,opt,name=preprocess,proto3" json:"preprocess,omitempty" yaml:"preprocess,omitempty"` AfterPreprocess string `` /* 141-byte string literal not displayed */ BeforePostprocess string `` /* 149-byte string literal not displayed */ Postprocess string `protobuf:"bytes,14,opt,name=postprocess,proto3" json:"postprocess,omitempty" yaml:"postprocess,omitempty"` AfterPostprocess string `` /* 145-byte string literal not displayed */ Model ModelAssets `protobuf:"bytes,16,opt,name=model" json:"model,omitempty" yaml:"model,omitempty"` Attributes map[string]string `` /* 183-byte string literal not displayed */ Hidden bool `protobuf:"varint,18,opt,name=hidden,proto3" json:"hidden,omitempty" yaml:"hidden,omitempty"` LargeModel bool `json:"large_model,omitempty" yaml:"large_model,omitempty"` InputImageDimensions *[]uint32 `json:"-" yaml:"-"` InputMean *[]float32 `json:"-" yaml:"-"` }
func (ModelManifest) CanonicalName ¶
func (model ModelManifest) CanonicalName() (string, error)
func (ModelManifest) Download ¶
func (model ModelManifest) Download(ctx context.Context) (err error)
func (ModelManifest) GetFeaturesPath ¶
func (model ModelManifest) GetFeaturesPath() string
func (ModelManifest) GetFeaturesUrl ¶
func (model ModelManifest) GetFeaturesUrl() string
func (ModelManifest) GetGraphPath ¶
func (model ModelManifest) GetGraphPath() string
func (ModelManifest) GetGraphUrl ¶
func (model ModelManifest) GetGraphUrl() string
func (ModelManifest) GetImageDimensions ¶
func (model ModelManifest) GetImageDimensions() ([]uint32, error)
func (ModelManifest) GetMeanImage ¶
func (model ModelManifest) GetMeanImage() ([]float32, error)
func (ModelManifest) GetWeightsPath ¶
func (model ModelManifest) GetWeightsPath() string
func (ModelManifest) GetWeightsUrl ¶
func (model ModelManifest) GetWeightsUrl() string
func (ModelManifest) MustCanonicalName ¶
func (model ModelManifest) MustCanonicalName() string
func (ModelManifest) WorkDir ¶
func (model ModelManifest) WorkDir() string
type ModelManifest_Type ¶
type ModelManifest_Type struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty" yaml:"type,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description,omitempty"` Parameters map[string]interface{} `` /* 175-byte string literal not displayed */ }
type ModelManifests ¶
type ModelManifests []ModelManifest
func FilterLargeModels ¶
func FilterLargeModels(filter string) (ModelManifests, error)
func FilterModels ¶
func FilterModels(filter string) (ModelManifests, error)