FOV_Converter / app.py
SIyUU's picture
add application file
e2a4b43
raw
history blame contribute delete
627 Bytes
import gradio as gr
import math
def fov_to_camera_angle(fov):
return fov * (math.pi / 180)
def camera_angle_to_fov(camera_angle):
return camera_angle * (180 / math.pi)
def converter(choice, value):
if choice == 'FOV to Camera Angle':
return fov_to_camera_angle(value)
else:
return camera_angle_to_fov(value)
fov_converter_interface = gr.Interface(
converter,
inputs=[gr.Radio(['FOV to Camera Angle', 'Camera Angle to FOV'], label="Conversion Choice"), gr.Number(label="Input Value")],
outputs=gr.Text(label="Conversion Result")
)
fov_converter_interface.launch()