Documentation
¶
Index ¶
- func ArgMax(s []float32) (int, float32, error)
- func CloseFile(file io.Closer) error
- func CopyFile(from string, to string) error
- func CreateFile(fileName string, isDir bool) error
- func DeleteFile(filename string) error
- func FileExists(filename string) (bool, error)
- func GetPathType(path string) string
- func LoadImagesFromPaths(paths []string) ([]image.Image, error)
- func Mean(vector []float32) float32
- func NewFileWriter(filename string, contentType string) (io.WriteCloser, error)
- func Norm(v []float32, p int) float64
- func Normalize(embedding []float32, p int) []float32
- func OpenFile(filename string) (io.ReadCloser, error)
- func PathJoinSafe(elem ...string) string
- func ReadFileBytes(filename string) ([]byte, error)
- func ReadLine(r *bufio.Reader) ([]byte, error)
- func Sigmoid(s []float32) []float32
- func SoftMax(vector []float32) []float32
- func SumSlice(s []float64) float64
- func WalkDir() func(ctx context.Context, URL string, handler storage.OnVisit, ...) error
- type CenterCropPreprocessor
- type NormalizationStep
- type PixelNormalizationPreprocessor
- type PreprocessStep
- type RescalePreprocessor
- type ResizePreprocessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶ added in v0.3.2
func DeleteFile ¶ added in v0.3.2
func FileExists ¶ added in v0.3.2
func GetPathType ¶
func LoadImagesFromPaths ¶ added in v0.5.0
func NewFileWriter ¶ added in v0.3.2
func NewFileWriter(filename string, contentType string) (io.WriteCloser, error)
func Normalize ¶
Normalize single vector according to: https://pytorch.org/docs/stable/generated/torch.nn.functional.normalize.html
func PathJoinSafe ¶
PathJoinSafe wrapper around filepath.Join to ensure that paths are correctly constructed if the path is a normal OS path, just use filepath.Join if the path is S3, trim any trailing slashes and construct it manually from the components so that double slashes (e.g. s3://) are preserved.
func ReadFileBytes ¶
func ReadLine ¶ added in v0.3.0
ReadLine returns a single line (without the ending \n) from the input buffered reader. An error is returned if there is an error with the buffered reader. This function is needed to avoid the 65K char line limit
Types ¶
type CenterCropPreprocessor ¶ added in v0.5.0
type CenterCropPreprocessor struct {
// contains filtered or unexported fields
}
func CenterCropStep ¶ added in v0.5.0
func CenterCropStep(targetWidth, targetHeight int) *CenterCropPreprocessor
type NormalizationStep ¶ added in v0.5.0
type PixelNormalizationPreprocessor ¶ added in v0.5.0
type PixelNormalizationPreprocessor struct {
// contains filtered or unexported fields
}
func ImagenetPixelNormalizationStep ¶ added in v0.5.0
func ImagenetPixelNormalizationStep() *PixelNormalizationPreprocessor
func PixelNormalizationStep ¶ added in v0.5.0
func PixelNormalizationStep(mean, std [3]float32) *PixelNormalizationPreprocessor
type PreprocessStep ¶ added in v0.5.0
type RescalePreprocessor ¶ added in v0.5.0
type RescalePreprocessor struct{}
func RescaleStep ¶ added in v0.5.0
func RescaleStep() *RescalePreprocessor
type ResizePreprocessor ¶ added in v0.5.0
type ResizePreprocessor struct {
// contains filtered or unexported fields
}
func ResizeStep ¶ added in v0.5.0
func ResizeStep(targetSize int) *ResizePreprocessor
Click to show internal directories.
Click to hide internal directories.