211 lines
8.2 KiB
Go
211 lines
8.2 KiB
Go
package model
|
|
|
|
type MaterialAsset struct {
|
|
SchemaVersion string `json:"schema_version"`
|
|
AnalyzerVersion string `json:"analyzer_version"`
|
|
FeatureSchema string `json:"feature_schema"`
|
|
Generator string `json:"generator"`
|
|
GeneratedAt string `json:"generated_at"`
|
|
SKU string `json:"sku"`
|
|
Category string `json:"category"`
|
|
Material string `json:"material"`
|
|
Product ProductSnapshot `json:"product"`
|
|
Input InputInfo `json:"input"`
|
|
Visual VisualFeatures `json:"visual"`
|
|
Texture TextureFeatures `json:"texture"`
|
|
Canonical CanonicalStatistics `json:"canonical_statistics"`
|
|
Semantic SemanticFeatures `json:"semantic"`
|
|
MaterialSpecific map[string]interface{} `json:"material_specific"`
|
|
Embeddings EmbeddingManifest `json:"embeddings"`
|
|
Validation ValidationReport `json:"validation"`
|
|
Confidence map[string]float64 `json:"confidence,omitempty"`
|
|
Warnings []string `json:"warnings,omitempty"`
|
|
}
|
|
|
|
type InputInfo struct {
|
|
ImageURL string `json:"image_url"`
|
|
ImageCachePath string `json:"image_cache_path,omitempty"`
|
|
OriginalWidth int `json:"original_width"`
|
|
OriginalHeight int `json:"original_height"`
|
|
AnalysisStrategy string `json:"analysis_strategy"`
|
|
AnalysisRegion string `json:"analysis_region"`
|
|
RoomLike bool `json:"room_like"`
|
|
RoomLikeConfidence string `json:"room_like_confidence,omitempty"`
|
|
RoomLikeReason string `json:"room_like_reason,omitempty"`
|
|
SourceImageFormat string `json:"source_image_format,omitempty"`
|
|
GeneratedPreview string `json:"generated_preview"`
|
|
GeneratedThumbnail string `json:"generated_thumbnail"`
|
|
GeneratedHistogram string `json:"generated_histogram"`
|
|
GeneratedEmbeddings string `json:"generated_embeddings"`
|
|
}
|
|
|
|
type RGB struct {
|
|
R int `json:"r"`
|
|
G int `json:"g"`
|
|
B int `json:"b"`
|
|
}
|
|
|
|
type LAB struct {
|
|
L float64 `json:"l"`
|
|
A float64 `json:"a"`
|
|
B float64 `json:"b"`
|
|
}
|
|
|
|
type HSV struct {
|
|
H float64 `json:"h"`
|
|
S float64 `json:"s"`
|
|
V float64 `json:"v"`
|
|
}
|
|
|
|
type ColorCluster struct {
|
|
RGB RGB `json:"rgb"`
|
|
LAB LAB `json:"lab"`
|
|
HSV HSV `json:"hsv"`
|
|
Percentage float64 `json:"percentage"`
|
|
}
|
|
|
|
type VisualFeatures struct {
|
|
DominantRGB RGB `json:"dominant_rgb"`
|
|
SecondaryRGB RGB `json:"secondary_rgb"`
|
|
DominantLAB LAB `json:"dominant_lab"`
|
|
DominantHSV HSV `json:"dominant_hsv"`
|
|
AverageRGB RGB `json:"average_rgb"`
|
|
AverageLAB LAB `json:"average_lab"`
|
|
AverageHSV HSV `json:"average_hsv"`
|
|
Brightness float64 `json:"brightness"`
|
|
Contrast float64 `json:"contrast"`
|
|
Saturation float64 `json:"saturation"`
|
|
ColorClusters []ColorCluster `json:"color_clusters"`
|
|
HistogramBins int `json:"histogram_bins"`
|
|
HistogramSpace string `json:"histogram_space"`
|
|
}
|
|
|
|
type ColorHistogram struct {
|
|
Space string `json:"space"`
|
|
BinsPerAxis int `json:"bins_per_axis,omitempty"`
|
|
Bins []int `json:"bins,omitempty"`
|
|
Values []float64 `json:"values"`
|
|
}
|
|
|
|
type GLCMFeatures struct {
|
|
Levels int `json:"levels"`
|
|
Contrast float64 `json:"contrast"`
|
|
Homogeneity float64 `json:"homogeneity"`
|
|
Energy float64 `json:"energy"`
|
|
Correlation float64 `json:"correlation"`
|
|
}
|
|
|
|
type TextureFeatures struct {
|
|
Entropy float64 `json:"entropy"`
|
|
TextureFrequency float64 `json:"texture_frequency"`
|
|
EdgeDensity float64 `json:"edge_density"`
|
|
OrientationVariance float64 `json:"orientation_variance"`
|
|
PrimaryOrientationDeg float64 `json:"primary_orientation_deg"`
|
|
LBPUniformity float64 `json:"lbp_uniformity"`
|
|
GLCM GLCMFeatures `json:"glcm"`
|
|
Algorithm string `json:"algorithm"`
|
|
}
|
|
|
|
type CanonicalStatistics struct {
|
|
MeanRGB RGB `json:"mean_rgb"`
|
|
MedianRGB RGB `json:"median_rgb"`
|
|
ColorVariance float64 `json:"color_variance"`
|
|
TextureVariance float64 `json:"texture_variance"`
|
|
BrightnessDistribution []float64 `json:"brightness_distribution"`
|
|
DominantOrientationDeg float64 `json:"dominant_orientation_deg"`
|
|
GradientHistogram []float64 `json:"gradient_histogram"`
|
|
GradientHistogramBins int `json:"gradient_histogram_bins"`
|
|
BrightnessHistogramBins int `json:"brightness_histogram_bins"`
|
|
}
|
|
|
|
type SemanticFeatures struct {
|
|
Provider string `json:"provider"`
|
|
Model string `json:"model,omitempty"`
|
|
Description string `json:"description"`
|
|
MaterialType string `json:"material_type"`
|
|
SurfaceFinish string `json:"surface_finish"`
|
|
GrainType string `json:"grain_type"`
|
|
ColorFamily string `json:"color_family"`
|
|
VisualStyle string `json:"visual_style"`
|
|
Variation string `json:"variation"`
|
|
GlossLevel string `json:"gloss_level"`
|
|
Grain string `json:"grain,omitempty"`
|
|
Tags []string `json:"tags,omitempty"`
|
|
Confidence float64 `json:"confidence"`
|
|
FieldConfidence map[string]float64 `json:"field_confidence,omitempty"`
|
|
}
|
|
|
|
type EmbeddingManifest struct {
|
|
File string `json:"file"`
|
|
Format string `json:"format"`
|
|
Vectors []EmbeddingVector `json:"vectors"`
|
|
}
|
|
|
|
type EmbeddingVector struct {
|
|
Name string `json:"name"`
|
|
Model string `json:"model,omitempty"`
|
|
Dimensions int `json:"dimensions"`
|
|
OffsetBytes int64 `json:"offset_bytes"`
|
|
ByteLength int64 `json:"byte_length"`
|
|
Generator string `json:"generator"`
|
|
Provider string `json:"provider,omitempty"`
|
|
Normalize bool `json:"normalize"`
|
|
}
|
|
|
|
type ValidationReport struct {
|
|
Status string `json:"status"`
|
|
CheckedAt string `json:"checked_at"`
|
|
Errors []string `json:"errors,omitempty"`
|
|
Warnings []string `json:"warnings,omitempty"`
|
|
}
|
|
|
|
type AssetManifest struct {
|
|
SKU string `json:"sku"`
|
|
AnalyzerVersion string `json:"analyzer_version"`
|
|
FeatureSchema string `json:"feature_schema"`
|
|
GeneratedAt string `json:"generated_at"`
|
|
Files []string `json:"files"`
|
|
FileDetails []ManifestFile `json:"file_details,omitempty"`
|
|
Status string `json:"status"`
|
|
Validation ValidationReport `json:"validation"`
|
|
Warnings []string `json:"warnings,omitempty"`
|
|
}
|
|
|
|
type ManifestFile struct {
|
|
Path string `json:"path"`
|
|
SHA256 string `json:"sha256"`
|
|
SizeBytes int64 `json:"size_bytes"`
|
|
CreatedTime string `json:"created_time"`
|
|
}
|
|
|
|
type BatchBenchmark struct {
|
|
AnalyzerVersion string `json:"analyzer_version"`
|
|
FeatureSchema string `json:"feature_schema"`
|
|
Generator string `json:"generator"`
|
|
StartedAt string `json:"started_at"`
|
|
CompletedAt string `json:"completed_at"`
|
|
DataDir string `json:"data_dir"`
|
|
OutputDir string `json:"output_dir"`
|
|
EmbeddingProvider string `json:"embedding_provider"`
|
|
SemanticProvider string `json:"semantic_provider"`
|
|
TotalSKU int `json:"total_sku"`
|
|
Processed int `json:"processed"`
|
|
Skipped int `json:"skipped"`
|
|
Failed int `json:"failed"`
|
|
AverageTimeMS float64 `json:"average_time_ms"`
|
|
Workers int `json:"workers"`
|
|
ImageResolutionDistribution map[string]int `json:"image_resolution_distribution,omitempty"`
|
|
}
|
|
|
|
type FailureReport struct {
|
|
GeneratedAt string `json:"generated_at"`
|
|
Failures []FailureItem `json:"failures"`
|
|
}
|
|
|
|
type FailureItem struct {
|
|
SKU string `json:"sku"`
|
|
Error string `json:"error"`
|
|
Attempts int `json:"attempts"`
|
|
DurationMS int64 `json:"duration_ms"`
|
|
}
|