Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.1 Dataframe empty row #1303

Closed
1 task done
Zengyf-CVer opened this issue May 17, 2022 · 10 comments · Fixed by #1936
Closed
1 task done

3.0.1 Dataframe empty row #1303

Zengyf-CVer opened this issue May 17, 2022 · 10 comments · Fixed by #1936
Assignees
Labels
bug Something isn't working good first issue Good for newcomers python Backend-related issue (Python)
Milestone

Comments

@Zengyf-CVer
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

@pngwn
I am using gradio 3.0.1 and found that there is a problem with blank rows in Dataframe output: when the data is less than 3 rows, there are blank rows, as shown in the figure.

Reproduction

ksnip_20220517-083436

ksnip_20220517-083448

ksnip_20220517-083504

Screenshot

No response

Logs

No response

System Info

gradio 3.0.1
ubuntu 20.04
chrome

Severity

annoyance

@Zengyf-CVer Zengyf-CVer added the bug Something isn't working label May 17, 2022
@pngwn
Copy link
Member

pngwn commented May 17, 2022

Can you show me the code you are using to generate this Dataframe please.

@Zengyf-CVer
Copy link
Contributor Author

@pngwn
My project: https://huggingface.co/spaces/Zengyf-CVer/Gradio_YOLOv5_Det_v3
You can enter a picture with a picture of one object or two objects.

@pngwn
Copy link
Member

pngwn commented May 17, 2022

Ah thanks.

@pngwn
Copy link
Member

pngwn commented May 17, 2022

What is happening here is the dataframe is always respecting the row_count as a minimum. If you set row_count to 1 on the Dataframe it works as expected. Not sure what the best behaviour is here.

cc @abidlabs @aliabid94

@pngwn
Copy link
Member

pngwn commented May 17, 2022

Just to clarify, the default row_count is 3 which is why those 3 rows are visible.

@abidlabs
Copy link
Member

This seems like reasonable behavior to me for the Dataframe to initialize with the stated number of rows. What we need to do is implement a "delete row / delete column" functionality to address these kinds of situations

@pngwn
Copy link
Member

pngwn commented May 17, 2022

This specific case is about whether the rows should match what comes back from the predict function or if it should respect the row count in that case as well. As an output the dataframe wouldn't have add/ delete functionality.

Input and outputs aren't significantly different so what makes sense for an input doesn't always make sense for an output (although I'm not sure that is the case here) but we can modify the behaviour of static vs dynamic components.

@Zengyf-CVer
Copy link
Contributor Author

When the output Dataframe defaults to 3 lines, it will make users think that there is an illusion of outputting empty lines.

@abidlabs
Copy link
Member

This specific case is about whether the rows should match what comes back from the predict function or if it should respect the row count in that case as well. As an output the dataframe wouldn't have add/ delete functionality.

Oh sorry I didn't read carefully. Going off of your comment @pngwn, what if we make the default # of rows be 0 or 1. We could do this for static dataframes only, but I don't see it being a problem for dynamic dataframes either (especially right now given that you can only add rows, not delete them).

@abidlabs abidlabs reopened this May 18, 2022
@abidlabs
Copy link
Member

(sorry accidentally closed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers python Backend-related issue (Python)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants