ditch mean error for now
Browse files
app.py
CHANGED
|
@@ -6,15 +6,15 @@ from gradio_imageslider import ImageSlider
|
|
| 6 |
|
| 7 |
def compute_simple_diff(imgs: tuple[np.array, np.array]) -> (np.array, float):
|
| 8 |
'''compute difference of two arrays'''
|
| 9 |
-
return imgs[0] - imgs[1]
|
| 10 |
|
| 11 |
|
| 12 |
def compute_flip_diff(imgs: tuple[np.array, np.array]) -> (np.array, float):
|
| 13 |
'''
|
| 14 |
compute NVIDIA nvlab's FLIP difference between two image arrays
|
| 15 |
'''
|
| 16 |
-
error_map,
|
| 17 |
-
return error_map
|
| 18 |
|
| 19 |
|
| 20 |
examples = [
|
|
@@ -31,12 +31,10 @@ with gr.Blocks() as demo:
|
|
| 31 |
# outputs=[diff, meanbox]
|
| 32 |
# )
|
| 33 |
button = gr.Button("Compute difference")
|
| 34 |
-
meanbox = gr.Textbox(label="Mean difference")
|
| 35 |
button.click(fn=compute_flip_diff,
|
| 36 |
inputs=image_slider,
|
| 37 |
-
outputs=[diff
|
| 38 |
)
|
| 39 |
-
meanbox.render()
|
| 40 |
|
| 41 |
|
| 42 |
if __name__ == "__main__":
|
|
|
|
| 6 |
|
| 7 |
def compute_simple_diff(imgs: tuple[np.array, np.array]) -> (np.array, float):
|
| 8 |
'''compute difference of two arrays'''
|
| 9 |
+
return imgs[0] - imgs[1]
|
| 10 |
|
| 11 |
|
| 12 |
def compute_flip_diff(imgs: tuple[np.array, np.array]) -> (np.array, float):
|
| 13 |
'''
|
| 14 |
compute NVIDIA nvlab's FLIP difference between two image arrays
|
| 15 |
'''
|
| 16 |
+
error_map, _, _ = flip.evaluate(imgs[0], imgs[1], "HDR")
|
| 17 |
+
return error_map
|
| 18 |
|
| 19 |
|
| 20 |
examples = [
|
|
|
|
| 31 |
# outputs=[diff, meanbox]
|
| 32 |
# )
|
| 33 |
button = gr.Button("Compute difference")
|
|
|
|
| 34 |
button.click(fn=compute_flip_diff,
|
| 35 |
inputs=image_slider,
|
| 36 |
+
outputs=[diff]
|
| 37 |
)
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
if __name__ == "__main__":
|