Add image perspective editing and related tools

- Implemented the Image Perspective tool for editing image corners in Blender.
- Created a new operator `EditImagePerspective` to handle the perspective transformation.
- Added a preview feature for the perspective adjustment.
- Introduced the `ImagePolylineTool` for editing image masks with polylines.
- Developed backend support for Real-ESRGAN model inference, including ONNX integration.
- Added functionality for image masking and background removal.
- Created unit tests for the Real-ESRGAN ONNX model to ensure correct preprocessing and inference.
This commit is contained in:
2026-08-22 22:17:10 +08:00
parent f42cba1932
commit 1613bd3194
45 changed files with 1802 additions and 1133 deletions

View File

@@ -89,6 +89,35 @@ class ModelTest(unittest.TestCase):
"BEN2-ONNX",
)
def test_realesrgan_general_x4v3_uses_verified_onnx_artifact(self):
model = self.models.get_downloadable_model(
"REALESRGAN_GENERAL_X4V3"
)
self.assertEqual(
model.repository,
"jonathanst29/tinier-upscale-models",
)
self.assertEqual(model.license_name, "BSD 3-Clause")
self.assertEqual(
model.download_patterns,
("realesr-general-x4v3.onnx",),
)
self.assertEqual(model.ready_patterns, model.download_patterns)
self.assertEqual(model.r2_directory, "realesr-general-x4v3")
self.assertEqual(
model.r2_files,
((
"realesr-general-x4v3.onnx",
4866396,
"924ebad6532777303582d4ce7811849b88869231a3ae7093e0f21200249df8d5",
),),
)
self.assertEqual(
self.models.model_record(model)["family"],
"upscale",
)
def test_enabled_da3_models_use_onnx_and_r2_checksums(self):
for model in self.models.MODELS.values():
if not model.enabled: