Spaces:
Runtime error
Runtime error
Commit
·
820bc58
1
Parent(s):
b4a5884
scaling state
Browse files
app.py
CHANGED
|
@@ -138,8 +138,10 @@ if __name__ == "__main__":
|
|
| 138 |
def update_scale(width:int, height:int, image: np.ndarray):
|
| 139 |
|
| 140 |
widthImage, heightImage = image.shape[:2]
|
| 141 |
-
|
| 142 |
-
return
|
|
|
|
|
|
|
| 143 |
image.change(fn=update_scale, inputs=[width, height, image], outputs=maxScale)
|
| 144 |
fit.click(fn=process, inputs=[width, height, scale, maxScale, image], outputs=[plot_output, total])
|
| 145 |
|
|
|
|
| 138 |
def update_scale(width:int, height:int, image: np.ndarray):
|
| 139 |
|
| 140 |
widthImage, heightImage = image.shape[:2]
|
| 141 |
+
scale = int((width/widthImage + height/heightImage)/2)
|
| 142 |
+
return {
|
| 143 |
+
maxScale: scale
|
| 144 |
+
}
|
| 145 |
image.change(fn=update_scale, inputs=[width, height, image], outputs=maxScale)
|
| 146 |
fit.click(fn=process, inputs=[width, height, scale, maxScale, image], outputs=[plot_output, total])
|
| 147 |
|