FloorMaterialAnalyzer/开发文档2

332 lines
4.2 KiB
Plaintext
Raw Normal View History

2026-07-27 03:03:51 +00:00
Material Analyzer Development Specification v2
Version: 2.0
Status: Development
Depends on: Material Analyzer Phase 1
1. Objective
The goal of Version 2 is not to introduce new downstream features such as Material QA or Texture Generation.
Instead, Version 2 focuses on upgrading the Material Analyzer into a production-grade offline analysis engine.
After completion, every flooring SKU should have a complete, stable, reproducible Material Asset that can serve as the Ground Truth across all future AI models.
2. Replace Placeholder Models
Current implementation uses deterministic placeholder vectors.
Replace them with real vision models.
2.1 DINOv2
Purpose
Extract texture-level visual embeddings.
Recommended model
facebook/dinov2-large
Output
1024-dim float32 vector
Store
embedding.bin
Metadata
{
"model":"dinov2-large",
"dimension":1024,
"normalize":true
}
Applications
Texture similarity
Material similarity
Drift detection
SKU retrieval
2.2 CLIP
Purpose
Extract semantic visual embeddings.
Recommended
ViT-L/14
Output
768-dim float32 vector
Applications
Semantic similarity
Recommendation
Search
3. Vision LLM Semantic Analyzer
Replace rule-based semantic generation.
Recommended models
Priority
Gemini 3 Pro Image
GPT-4o Vision
Claude Vision
Input
Texture Image
Output Schema
{
"description":"",
"material_type":"",
"surface_finish":"",
"grain_type":"",
"color_family":"",
"visual_style":"",
"variation":"",
"gloss_level":"",
"tags":[]
}
Important
LLM output should always be validated against JSON Schema.
Missing fields should be regenerated.
4. Feature Versioning
Every generated Material Asset must contain version information.
Example
{
"analyzer_version":"2.0.0",
"feature_schema":"2026.07",
"generated_at":"ISO8601",
"generator":"Material Analyzer"
}
Future schema changes must remain backward compatible.
5. Feature Validation
After extraction, automatically validate all features.
Example checks
Brightness ∈ [0,1]
Contrast ∈ [0,1]
Histogram length == 256
Embedding dimension == expected
Orientation ∈ [0,180]
Entropy > 0
Invalid assets should be regenerated.
6. Material Confidence
Every inferred feature should include a confidence score.
Example
{
"stone_type":"Travertine",
"confidence":0.91
}
This enables future QA weighting.
7. Canonical Material Statistics
Generate global statistics for every SKU.
Examples
Mean RGB
Median RGB
Color Variance
Texture Variance
Brightness Distribution
Dominant Orientation
Gradient Histogram
These statistics are independent of LLM output.
8. Asset Manifest
Every asset folder should contain
manifest.json
Example
{
"sku":"67907_847",
"files":[
"preview.jpg",
"thumbnail.jpg",
"material.json",
"embedding.bin",
"histogram.json"
],
"status":"complete"
}
This simplifies integrity checking.
9. Batch Processing
Improve offline processing.
Support
Incremental Update
Resume
Retry
Multi-thread
Progress Bar
Logging
Failure Report
Target
3500+ SKU
One-click processing
Resume after interruption
10. Analyzer Benchmark
Generate benchmark reports after every batch.
Example
Total SKU
Processed
Skipped
Failed
Average Time
Model Version
Feature Version
Image Resolution Distribution
Output
benchmark.json
11. Plugin Architecture
Future feature extractors should be pluggable.
Directory
analyzers/
color/
texture/
semantic/
embedding/
adapters/
plugins/
Every extractor should implement
Analyze(image) -> Feature
No module should depend directly on another module.
12. Future Compatibility
Analyzer output must remain stable for
Material QA
Canonical Texture Generator
Tile Detection
Pattern Detection
Similarity Search
AI Prompt Builder
Product Recommendation
Do not tightly couple Analyzer with any downstream module.
13. Development Priority
Phase 1 (Completed)
Universal Features
Texture Features
Rule-based Semantic
Placeholder Embedding
Phase 2 (Current)
DINOv2
CLIP
Vision LLM
Versioning
Validation
Confidence
Manifest
Phase 3
Canonical Texture Generator
Tile Detection
Image Quilting
Pattern Detector
Phase 4
Material QA
Drift Detection
Auto Retry