Existing problems

#6
by Yuliang - opened

Thanks, @chris-rannou @hysts @fffiloni @NimaBoscarino , we have finished the main part, but still a few issues as follows:

  1. Though the video could be played well locally, gr.Video can't, leaving a black block so I have to delete the gr.Video
  2. The download files are automatically renamed as download instead of xxxx_smpl.obj, and download.txt for xx_smpl.npy
  3. [URGENT] OOM for GPU after testing a few images, thus I have to restart the space again and again for users
  4. demo.launch(auth=) does not work, after a few minutes, it turns out to be 504 gateway
  5. the visualization of .obj file is flipped, but .glb displays correctly

The download issue should be fixed here: https://github.com/gradio-app/gradio/pull/1921 Aiming to ship in 3.2 release at the end of the next week but can cut a release earlier if needed. Same for auth - aiming to be fixed by the end of next week.

Regarding OOM, is it possible to not retain the graph when calling backward on cloth_loss here?

The download issue should be fixed here: https://github.com/gradio-app/gradio/pull/1921 Aiming to ship in 3.2 release at the end of the next week but can cut a release earlier if needed. Same for auth - aiming to be fixed by the end of next week.

Regarding OOM, is it possible to not retain the graph when calling backward on cloth_loss here?

I have solved the OOM problem by removing the retain_graph=True and add these codes at the end of processing function

    import gc
    # clean all the variables
    for element in dir():
        if 'path' not in element:
            del locals()[element]
    gc.collect()
    torch.cuda.empty_cache()

@Yuliang

  1. Though the video could be played well locally, gr.Video can't, leaving a black block so I have to delete the gr.Video

I had the same issue a little while ago. I think you need to use a different video codec.
https://huggingface.co/spaces/Yuliang/ICON/blob/main/lib/common/render.py#L344
https://github.com/gradio-app/gradio/issues/1508#issuecomment-1154545730

But in my understanding, opencv-python installed from PyPI is not built with x264 due to a license issue, so the avc1 codec is not available with it.
As a workaround, you can call ffmpeg command using subprocess.run like this: https://huggingface.co/spaces/hysts/ViTPose_video/blob/main/model.py#L242-L244
As another workaround, you can use imageio and imageio-ffmpeg to create a video encoded with avc1, instead of cv2.VideoWriter.

@Yuliang

  1. Though the video could be played well locally, gr.Video can't, leaving a black block so I have to delete the gr.Video

I had the same issue a little while ago. I think you need to use a different video codec.
https://huggingface.co/spaces/Yuliang/ICON/blob/main/lib/common/render.py#L344
https://github.com/gradio-app/gradio/issues/1508#issuecomment-1154545730

But in my understanding, opencv-python installed from PyPI is not built with x264 due to a license issue, so the avc1 codec is not available with it.
As a workaround, you can call ffmpeg command using subprocess.run like this: https://huggingface.co/spaces/hysts/ViTPose_video/blob/main/model.py#L242-L244
As another workaround, you can use imageio and imageio-ffmpeg to create a video encoded with avc1, instead of cv2.VideoWriter.

Really thanks for your suggestion, now the video visualization works!

  1. The download files are automatically renamed as download instead of xxxx_smpl.obj, and download.txt for xx_smpl.npy

Regarding this problem, i found 2 topics on gradio github's discussions page that could help you figure it out:

gr.File() file content read:

โ€”โ€บ https://github.com/gradio-app/gradio/discussions/1624

How to get original uploaded file name instead of temporary file name ?:

โ€”โ€บ https://github.com/gradio-app/gradio/discussions/133

โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

It seems that there is a bug about this though, as reported here:

Download button does not respect the filepath returned by the function:

โ€”โ€บ https://github.com/gradio-app/gradio/issues/1689

  1. demo.launch(auth=) does not work, after a few minutes, it turns out to be 504 gateway

regarding the auth issue, @abidlabs said :

Auth is now working on Gradio 3.0 (thanks @pngwn !).
However, it does not work with Spaces -- so leaving this issue open (albeit renamed).

โ€”โ€บ https://github.com/gradio-app/gradio/issues/1259#issuecomment-1128922425

Sign up or log in to comment