Spaces:
Build error
Build error
Update app.py
Browse files37 unmodified lines383940414243444546126 unmodified lines17317417517617717817937 unmodified linesdef predict(pilimg,Threshold):image_np = pil_image_as_numpy_array(pilimg)if type(Threshold) is None or Threshold == 0:Threshold=0.88return predict2(image_np,Threshold),predict3(image_np,Threshold),Threshold126 unmodified linesbase_image = gr.Interface(fn=predict,# inputs=[gr.Image(type="pil"),gr.Slider(minimum=0.01, maximum=1, value=0.38 ,label="Threshold",info="[not in used]to set prediction confidence threshold")],inputs=[gr.Image(type="pil"),gr.Slider(minimum=0.01, maximum=1,value=threshold_d ,label="[WIP]To change default 0.38 prediction confidence Threshold",info="[not in used]Select image with 0.38 threshold to start, you may amend threshold after each first image inference")],outputs=[gr.Image(type="pil",label="Base Model Inference"),gr.Image(type="pil",label="Tuned Model Inference"),gr.Textbox(label="[WIP]Both images inferenced threshold")],title="Luffy and Chopper Head detection. SSD mobile net V2 320x320",37 unmodified lines38394041424344454647126 unmodified lines17417517617717817918037 unmodified linesdef predict(pilimg,Threshold):image_np = pil_image_as_numpy_array(pilimg)Threshold1= float(Threshold)if type(Threshold1) is None or Threshold1 == 0:Threshold=0.88return predict2(image_np,Threshold),predict3(image_np,Threshold),Threshold126 unmodified linesbase_image = gr.Interface(fn=predict,# inputs=[gr.Image(type="pil"),gr.Slider(minimum=0.01, maximum=1, value=0.38 ,label="Threshold",info="[not in used]to set prediction confidence threshold")],inputs=[gr.Image(type="pil"),gr.Textbox(value=threshold_d ,label="[WIP]To change default 0.38 prediction confidence Threshold",info="[not in used]Select image with 0.38 threshold to start, you may amend threshold after each first image inference")],outputs=[gr.Image(type="pil",label="Base Model Inference"),gr.Image(type="pil",label="Tuned Model Inference"),gr.Textbox(label="[WIP]Both images inferenced threshold")],title="Luffy and Chopper Head detection. SSD mobile net V2 320x320",
app.py+4-3