Instructions to use agents2agents/SyncFix-RTX-5090 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use agents2agents/SyncFix-RTX-5090 with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Support variable image dimensions
#1
by a2a2a2a - opened
.gitattributes
CHANGED
|
@@ -10,4 +10,4 @@ data/kernels/ka683f0c89c82baad.cubin filter=lfs diff=lfs merge=lfs -text
|
|
| 10 |
example/expected_0.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
example/expected_1.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
example/expected_2.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
runtime/syncfix_5090_runtime-0.1.
|
|
|
|
| 10 |
example/expected_0.png filter=lfs diff=lfs merge=lfs -text
|
| 11 |
example/expected_1.png filter=lfs diff=lfs merge=lfs -text
|
| 12 |
example/expected_2.png filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
runtime/syncfix_5090_runtime-0.1.1-cp312-cp312-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
|
MANIFEST.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
"files": {
|
| 5 |
".gitattributes": {
|
| 6 |
"bytes": 663,
|
| 7 |
-
"sha256": "
|
| 8 |
},
|
| 9 |
".gitignore": {
|
| 10 |
"bytes": 66,
|
|
@@ -19,12 +19,12 @@
|
|
| 19 |
"sha256": "b0fb7e456cd291420e7ef3ecdef7799f8719a3e4a8faf401cc0a4b8c6393ba00"
|
| 20 |
},
|
| 21 |
"README.md": {
|
| 22 |
-
"
|
| 23 |
-
"
|
| 24 |
},
|
| 25 |
"bundle.json": {
|
| 26 |
"bytes": 21460,
|
| 27 |
-
"sha256": "
|
| 28 |
},
|
| 29 |
"data/kernels/k0145dc93e7859f26.cubin": {
|
| 30 |
"bytes": 40304,
|
|
@@ -766,9 +766,9 @@
|
|
| 766 |
"bytes": 3034,
|
| 767 |
"sha256": "32b348f33369c4096b7f568cd01daded1617eb14416720a2be091d149c37d118"
|
| 768 |
},
|
| 769 |
-
"runtime/syncfix_5090_runtime-0.1.
|
| 770 |
-
"bytes":
|
| 771 |
-
"sha256": "
|
| 772 |
},
|
| 773 |
"setup.sh": {
|
| 774 |
"bytes": 1325,
|
|
@@ -779,8 +779,8 @@
|
|
| 779 |
"sha256": "17f240ae101143707e5e7303a5d800450d9ccc7475b463cedb555cefdb3c6ece"
|
| 780 |
},
|
| 781 |
"verify.py": {
|
| 782 |
-
"
|
| 783 |
-
"
|
| 784 |
}
|
| 785 |
}
|
| 786 |
}
|
|
|
|
| 4 |
"files": {
|
| 5 |
".gitattributes": {
|
| 6 |
"bytes": 663,
|
| 7 |
+
"sha256": "b356e88ab388d4b33e681fdcb1582424b9bcc8c67ad57a5ebe8eb1a517a3bf44"
|
| 8 |
},
|
| 9 |
".gitignore": {
|
| 10 |
"bytes": 66,
|
|
|
|
| 19 |
"sha256": "b0fb7e456cd291420e7ef3ecdef7799f8719a3e4a8faf401cc0a4b8c6393ba00"
|
| 20 |
},
|
| 21 |
"README.md": {
|
| 22 |
+
"bytes": 3265,
|
| 23 |
+
"sha256": "ef816d185adcf67cca5b5699f0e94c4974f312ef6cf007259be0dcc5c5649cd5"
|
| 24 |
},
|
| 25 |
"bundle.json": {
|
| 26 |
"bytes": 21460,
|
| 27 |
+
"sha256": "31cccba188531faa2ed9f677b07bd450d3f3445995d0be240bd9697f45241b84"
|
| 28 |
},
|
| 29 |
"data/kernels/k0145dc93e7859f26.cubin": {
|
| 30 |
"bytes": 40304,
|
|
|
|
| 766 |
"bytes": 3034,
|
| 767 |
"sha256": "32b348f33369c4096b7f568cd01daded1617eb14416720a2be091d149c37d118"
|
| 768 |
},
|
| 769 |
+
"runtime/syncfix_5090_runtime-0.1.1-cp312-cp312-linux_x86_64.whl": {
|
| 770 |
+
"bytes": 988304,
|
| 771 |
+
"sha256": "a14cb6e5cdce664f8091cb7be4a1c6ab58023028d3dde3614cd341112fd867e7"
|
| 772 |
},
|
| 773 |
"setup.sh": {
|
| 774 |
"bytes": 1325,
|
|
|
|
| 779 |
"sha256": "17f240ae101143707e5e7303a5d800450d9ccc7475b463cedb555cefdb3c6ece"
|
| 780 |
},
|
| 781 |
"verify.py": {
|
| 782 |
+
"bytes": 9478,
|
| 783 |
+
"sha256": "998c94b8aae9e53d7a1a0440ac434f7937a2c76635dc3bf5a78fcbc682b920de"
|
| 784 |
}
|
| 785 |
}
|
| 786 |
}
|
README.md
CHANGED
|
@@ -12,7 +12,8 @@ tags:
|
|
| 12 |
# SyncFix for RTX 5090
|
| 13 |
|
| 14 |
Process three degraded views and one reference image to produce three corrected
|
| 15 |
-
views.
|
|
|
|
| 16 |
|
| 17 |
## Requirements
|
| 18 |
|
|
@@ -47,8 +48,9 @@ python verify.py --run --trt-lib-dir /path/to/TensorRT/lib
|
|
| 47 |
```
|
| 48 |
|
| 49 |
`verify.py` checks the downloaded files using Python alone. `--run` also checks inference
|
| 50 |
-
using the included example
|
| 51 |
-
processes. The first inference
|
|
|
|
| 52 |
|
| 53 |
## Run
|
| 54 |
|
|
|
|
| 12 |
# SyncFix for RTX 5090
|
| 13 |
|
| 14 |
Process three degraded views and one reference image to produce three corrected
|
| 15 |
+
views. Inputs must be RGB and may have different dimensions. Each output has the
|
| 16 |
+
same width and height as its corresponding degraded input image.
|
| 17 |
|
| 18 |
## Requirements
|
| 19 |
|
|
|
|
| 48 |
```
|
| 49 |
|
| 50 |
`verify.py` checks the downloaded files using Python alone. `--run` also checks inference
|
| 51 |
+
using the included example and a group of images with different dimensions.
|
| 52 |
+
Numerical checks allow small variation between processes. The first inference
|
| 53 |
+
includes initialization and warmup.
|
| 54 |
|
| 55 |
## Run
|
| 56 |
|
bundle.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"kind": "syncfix-rtx5090-bundle",
|
| 3 |
"schema_version": 1,
|
| 4 |
-
"version": "0.1.
|
| 5 |
"requires": {
|
| 6 |
"machine": "x86_64",
|
| 7 |
"system": "Linux",
|
|
|
|
| 1 |
{
|
| 2 |
"kind": "syncfix-rtx5090-bundle",
|
| 3 |
"schema_version": 1,
|
| 4 |
+
"version": "0.1.1",
|
| 5 |
"requires": {
|
| 6 |
"machine": "x86_64",
|
| 7 |
"system": "Linux",
|
runtime/{syncfix_5090_runtime-0.1.0-cp312-cp312-linux_x86_64.whl → syncfix_5090_runtime-0.1.1-cp312-cp312-linux_x86_64.whl}
RENAMED
|
Binary files a/runtime/syncfix_5090_runtime-0.1.0-cp312-cp312-linux_x86_64.whl and b/runtime/syncfix_5090_runtime-0.1.1-cp312-cp312-linux_x86_64.whl differ
|
|
|
verify.py
CHANGED
|
@@ -106,6 +106,7 @@ def compare_outputs(outputs, repeated, expected_paths, limit):
|
|
| 106 |
|
| 107 |
|
| 108 |
def run_example(root, trt_lib_dir):
|
|
|
|
| 109 |
from PIL import Image
|
| 110 |
from syncfix_5090 import Pipeline
|
| 111 |
example = read_json(asset(root, "bundle.json"))["example"]
|
|
@@ -116,11 +117,59 @@ def run_example(root, trt_lib_dir):
|
|
| 116 |
for name in paths:
|
| 117 |
with Image.open(asset(root, name)) as image:
|
| 118 |
inputs.append(image.convert("RGB"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
with Pipeline(root, trt_lib_dir=trt_lib_dir) as pipeline:
|
| 120 |
outputs = pipeline.infer(inputs[:3], inputs[3], seed=example["seed"])
|
|
|
|
| 121 |
repeated = pipeline.infer(inputs[:3], inputs[3], seed=example["seed"])
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
[asset(root, name) for name in example["expected_images"]], example["pixel_rms_limit"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
|
| 126 |
def main():
|
|
|
|
| 106 |
|
| 107 |
|
| 108 |
def run_example(root, trt_lib_dir):
|
| 109 |
+
import numpy as np
|
| 110 |
from PIL import Image
|
| 111 |
from syncfix_5090 import Pipeline
|
| 112 |
example = read_json(asset(root, "bundle.json"))["example"]
|
|
|
|
| 117 |
for name in paths:
|
| 118 |
with Image.open(asset(root, name)) as image:
|
| 119 |
inputs.append(image.convert("RGB"))
|
| 120 |
+
sizes = [(640, 480), (513, 769), (1920, 1080), (777, 431)]
|
| 121 |
+
varied = [image.resize(size) for image, size in zip(inputs, sizes)]
|
| 122 |
+
retained = []
|
| 123 |
+
ownership_valid = True
|
| 124 |
+
|
| 125 |
+
def retain(images):
|
| 126 |
+
nonlocal ownership_valid
|
| 127 |
+
for earlier, snapshots in retained:
|
| 128 |
+
ownership_valid = ownership_valid and len(earlier) == len(snapshots) and all(
|
| 129 |
+
np.array_equal(saved, np.asarray(image))
|
| 130 |
+
for saved, image in zip(snapshots, earlier))
|
| 131 |
+
snapshots = [np.asarray(image).copy() for image in images]
|
| 132 |
+
retained.append((images, snapshots))
|
| 133 |
+
return snapshots
|
| 134 |
+
|
| 135 |
with Pipeline(root, trt_lib_dir=trt_lib_dir) as pipeline:
|
| 136 |
outputs = pipeline.infer(inputs[:3], inputs[3], seed=example["seed"])
|
| 137 |
+
saved_outputs = retain(outputs)
|
| 138 |
repeated = pipeline.infer(inputs[:3], inputs[3], seed=example["seed"])
|
| 139 |
+
retain(repeated)
|
| 140 |
+
varied_outputs = pipeline.infer(varied[:3], varied[3], seed=example["seed"])
|
| 141 |
+
saved_varied = retain(varied_outputs)
|
| 142 |
+
varied_repeated = pipeline.infer(varied[:3], varied[3], seed=example["seed"])
|
| 143 |
+
retain(varied_repeated)
|
| 144 |
+
restored = pipeline.infer(inputs[:3], inputs[3], seed=example["seed"])
|
| 145 |
+
retain(restored)
|
| 146 |
+
for images, snapshots in retained:
|
| 147 |
+
ownership_valid = ownership_valid and len(images) == len(snapshots) and all(
|
| 148 |
+
np.array_equal(saved, np.asarray(image)) for saved, image in zip(snapshots, images))
|
| 149 |
+
result = compare_outputs(outputs, repeated,
|
| 150 |
[asset(root, name) for name in example["expected_images"]], example["pixel_rms_limit"])
|
| 151 |
+
shape_valid = len(varied_outputs) == len(varied_repeated) == 3 and all(
|
| 152 |
+
image.mode == "RGB" and image.size == size
|
| 153 |
+
for images in (varied_outputs, varied_repeated)
|
| 154 |
+
for image, size in zip(images, sizes[:3]))
|
| 155 |
+
repeated_equal = len(varied_repeated) == 3 and all(
|
| 156 |
+
np.array_equal(before, np.asarray(after))
|
| 157 |
+
for before, after in zip(saved_varied, varied_repeated))
|
| 158 |
+
varied_owned = len(varied_outputs) == 3 and all(
|
| 159 |
+
np.array_equal(before, np.asarray(after))
|
| 160 |
+
for before, after in zip(saved_varied, varied_outputs))
|
| 161 |
+
restored_equal = len(restored) == 3 and all(
|
| 162 |
+
np.array_equal(before, np.asarray(after))
|
| 163 |
+
for before, after in zip(saved_outputs, restored))
|
| 164 |
+
mixed = {"output_sizes": [list(image.size) for image in varied_outputs],
|
| 165 |
+
"expected_sizes": [list(size) for size in sizes[:3]],
|
| 166 |
+
"repeat_equal": repeated_equal,
|
| 167 |
+
"owned_outputs_unchanged": ownership_valid and varied_owned,
|
| 168 |
+
"return_to_original_inputs_equal": restored_equal,
|
| 169 |
+
"passed": shape_valid and repeated_equal and ownership_valid and varied_owned and restored_equal}
|
| 170 |
+
result["mixed_dimensions"] = mixed
|
| 171 |
+
result["passed"] = result["passed"] and mixed["passed"]
|
| 172 |
+
return result
|
| 173 |
|
| 174 |
|
| 175 |
def main():
|