- Add FeatureExtractor for CLIP-based image/text feature extraction - Add ObjectiveMetricsCalculator for technical quality metrics - Add VLMEvaluator for vision language model evaluation - Add HybridQualityGate combining objective + VLM evaluation - Enhance CharacterMemory with visual feature support - Add quality optional dependency (torch, ftfy, regex) - Add unit tests for new modules 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
114 lines
3.0 KiB
Python
114 lines
3.0 KiB
Python
# Copyright (C) 2025 AIDC-AI
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
"""
|
|
Quality Assurance Services for Pixelle-Video
|
|
|
|
This module provides quality control mechanisms for video generation:
|
|
- QualityGate: Evaluates generated content quality
|
|
- RetryManager: Smart retry with quality-based decisions
|
|
- OutputValidator: LLM output validation
|
|
- StyleGuard: Visual style consistency
|
|
- ContentFilter: Content moderation
|
|
- CharacterMemory: Character consistency across frames
|
|
"""
|
|
|
|
from pixelle_video.services.quality.models import (
|
|
QualityScore,
|
|
QualityConfig,
|
|
RetryConfig,
|
|
QualityError,
|
|
)
|
|
from pixelle_video.services.quality.quality_gate import (
|
|
QualityGate,
|
|
HybridQualityGate,
|
|
HybridQualityConfig,
|
|
)
|
|
from pixelle_video.services.quality.retry_manager import RetryManager
|
|
from pixelle_video.services.quality.output_validator import (
|
|
OutputValidator,
|
|
ValidationConfig,
|
|
ValidationResult,
|
|
)
|
|
from pixelle_video.services.quality.style_guard import (
|
|
StyleGuard,
|
|
StyleGuardConfig,
|
|
StyleAnchor,
|
|
)
|
|
from pixelle_video.services.quality.content_filter import (
|
|
ContentFilter,
|
|
ContentFilterConfig,
|
|
FilterResult,
|
|
FilterCategory,
|
|
)
|
|
from pixelle_video.services.quality.character_memory import (
|
|
CharacterMemory,
|
|
CharacterMemoryConfig,
|
|
Character,
|
|
CharacterType,
|
|
)
|
|
from pixelle_video.services.quality.feature_extractor import (
|
|
FeatureExtractor,
|
|
FeatureExtractorConfig,
|
|
)
|
|
from pixelle_video.services.quality.objective_metrics import (
|
|
ObjectiveMetricsCalculator,
|
|
TechnicalMetrics,
|
|
)
|
|
from pixelle_video.services.quality.vlm_evaluator import (
|
|
VLMEvaluator,
|
|
VLMEvaluatorConfig,
|
|
VLMEvaluationResult,
|
|
)
|
|
|
|
__all__ = [
|
|
# Quality evaluation
|
|
"QualityScore",
|
|
"QualityConfig",
|
|
"RetryConfig",
|
|
"QualityError",
|
|
"QualityGate",
|
|
"HybridQualityGate",
|
|
"HybridQualityConfig",
|
|
"RetryManager",
|
|
# Output validation
|
|
"OutputValidator",
|
|
"ValidationConfig",
|
|
"ValidationResult",
|
|
# Style consistency
|
|
"StyleGuard",
|
|
"StyleGuardConfig",
|
|
"StyleAnchor",
|
|
# Content moderation
|
|
"ContentFilter",
|
|
"ContentFilterConfig",
|
|
"FilterResult",
|
|
"FilterCategory",
|
|
# Character memory
|
|
"CharacterMemory",
|
|
"CharacterMemoryConfig",
|
|
"Character",
|
|
"CharacterType",
|
|
# Feature extraction (NEW)
|
|
"FeatureExtractor",
|
|
"FeatureExtractorConfig",
|
|
# Objective metrics (NEW)
|
|
"ObjectiveMetricsCalculator",
|
|
"TechnicalMetrics",
|
|
# VLM evaluation (NEW)
|
|
"VLMEvaluator",
|
|
"VLMEvaluatorConfig",
|
|
"VLMEvaluationResult",
|
|
]
|
|
|
|
|