gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Direct link to specific example in Gradio interface

Open abhigoku10 opened this issue 4 years ago • 16 comments
trafficstars

@abidlabs @julien-c thanks for open-sourcing this wonder app , i want to use gradio for object detection models can you please share some reference how to do it so that i can implement the same for my custom architecture. Thanks in adavance

abhigoku10 avatar Aug 13 '21 15:08 abhigoku10

@abhigoku10 Hi check out yolov5 gradio hub: https://gradio.app/hub/AK391/yolov5 repo: https://github.com/AK391/yolov5/blob/master/utils/gradio/demo.py

is that similar to what you are looking to do?

AK391 avatar Aug 13 '21 19:08 AK391

@thanks for the reference yes this is similar to what i am looking for , but in this the model is loaded to torch.hub , i wanted to custom model deployment and can we pass videos as input

abhigoku10 avatar Aug 14 '21 06:08 abhigoku10

@abhigoku10 yes you can load a custom model as well without using torch hub see this example https://github.com/AK391/vits/blob/main/gradiodemo.py

AK391 avatar Aug 14 '21 14:08 AK391

@AK391 thanks for the reference, i have other queries

  1. Can we have mouse event features on the uploaded image like clicking /drawing line

  2. Can we change the background colors of the selections, format of the text

  3. how to get options like shown below , i looked inot the example and noting points to having this as option image

  4. how to get the background like this , i am not able to see the output and window i can see the screenshot only image

  5. Can we have selection of inputs between image input and video input for the user (basically in radio button feature if i enable image it should load the input image or else video) Thanks for the support

abhigoku10 avatar Aug 16 '21 10:08 abhigoku10

@abhigoku10

  1. there is a image editor, can access by clicking edit in the image component area to draw lines on the image
  2. Not sure about this, can you clarify about the use case
  3. This should be added by gradio
  4. Is this from the yolov5 demo?
  5. You can have multiple input components like image and video but both would have to be populated currently for the demo to run

AK391 avatar Aug 16 '21 14:08 AK391

@AK391 thanks for the response

  1. in the image edit we have a drawing line but can we get the coordinate of the start and end points of the mouse event?
  2. the whole theme of gradio is orange / green/ blue can we change it to custom colors
  3. currently this feature is not getting added for the custom inference which i have
  4. yup this is from yolov5 demo
  5. I shall explain more " currently in all the demo case we have i have seen either we option to load image or video using gr.inputs.Image or gr.inputs.Video but if i want to give the option to the user to select which ever he wants how to do it ?? becuase currently i am getting like this below

image

abhigoku10 avatar Aug 16 '21 17:08 abhigoku10

@abhigoku10 regarding 6. see https://github.com/gradio-app/gradio/issues/236 optional input components are in the works currently user would have to populate both the fields for the front end to respond One option could be for the user to upload a video and then process the first frame of the video if the user is looking to process an image or process the entire video otherwise, if that fits your use case

AK391 avatar Aug 16 '21 22:08 AK391

@AK391 thanks for the response , but i shall wait since optional inputs are in progress . can you please respond for 1-4 points ?? 6. can the input radios by default be disabled and enabled only when clicked 7. Given a set of images in the examples can i come to knw what image will the user choose in the given list ??

abhigoku10 avatar Aug 17 '21 04:08 abhigoku10

@abhigoku10 for 1. not sure will look into it 2. see https://gradio.app/docs, css (str) - custom css or path to custom css file to use with interface. 3. do you have a link to the inferface or a screenshot of what you are seeing, should be enabled by default if you have a example image loaded for the interface 4. see above

AK391 avatar Aug 17 '21 16:08 AK391

@AK391 Thanks for teh response 3. please find the screeshot of the image

image

  1. can the input radios by default be disabled and enabled only when clicked
  2. Given a set of images in the examples can i come to knw what image will the user choose in the given list ??

abhigoku10 avatar Aug 17 '21 18:08 abhigoku10

@abhigoku10 3. and 4 can you try pip install gradio==1.7.0 the gallery view is showing for that version

AK391 avatar Aug 17 '21 20:08 AK391

@abhigoku10 6. https://gradio.app/docs#i_radio , try setting default=None 7. Not that i know of

AK391 avatar Aug 17 '21 20:08 AK391

@AK391 thanks for the response 3 and 4 are working on gradio == 1.7.0 so is it disabled at gradio 2.2.0?? 6. checked with that it's not working if used radio button by default first one is disabled

abhigoku10 avatar Aug 18 '21 05:08 abhigoku10

@abhigoku10 3 and 4, yes it is not available in 2.2.0 6. ok I tried testing this as well, for 1.7, default is not a option but for 2.2 it selects the first string in your list of choices for the radio button

AK391 avatar Aug 18 '21 14:08 AK391

@AK391 can we have 3,4 feature for 2.2.0 as well it will good from user perspective

abhigoku10 avatar Aug 18 '21 15:08 abhigoku10

To clarify, the main thing left here is for us to have a direct link to a specific example so that it preloaded when someone visits the link. E.g. http://127.0.0.1:7861/#1 loads the first example. We used to have this @aliabid94 and I think it is a useful feature. Can we bring it back?

abidlabs avatar Nov 03 '21 20:11 abidlabs

This could be expanded to being able to generate a direct link to any specific input that a user tries, which could help in shareability, especially for non-text or non-image demos.

abidlabs avatar Aug 17 '22 17:08 abidlabs

I'm going to close this in favor of #2269, which is a more general version of this issue and has more relevant context

abidlabs avatar Nov 04 '22 18:11 abidlabs