gaomingqi / Track-Anything

Track-Anything is a flexible and interactive tool for video object tracking and segmentation, based on Segment Anything, XMem, and E2FGVI.
MIT License
6.51k stars 482 forks source link

Gradio versions with issues #131

Open dophuchoan opened 7 months ago

dophuchoan commented 7 months ago

Hello all! I'm facing an issue with gradio. With the newest gradio version (4.27.0) - I got this issue:

TypeError: Row.init() got an unexpected keyword argument 'scale'

Then I followed all the guides from other members, and tried to downgrade the version to: 3.25, 3.48, and even 3.50.2 but they all gave back a lot of errors, like this:

(trackany) E:\___AI\Track_Anthing>python app.py --device cuda:0
Initializing BaseSegmenter to cuda:0
Hyperparameters read from the model weights: C^k=64, C^v=512, C^h=64
Single object mode: False
load pretrained SPyNet...
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmediting/restorers/basicvsr/spynet_20210409-c6c1bd09.pth
E:\___AI\Track_Anthing\app.py:431: GradioUnusedKwargWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 0.4}
  with gr.Row(scale=0.4):
E:\___AI\Track_Anthing\app.py:432: GradioUnusedKwargWarning: You have unused kwarg parameters in Video, please remove them: {'autosize': True}
  video_input = gr.Video(autosize=True)
E:\___AI\Track_Anthing\app.py:457: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  clear_button_click = gr.Button(value="Clear clicks", interactive=True, visible=False).style(height=160)
E:\___AI\Track_Anthing\app.py:459: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  template_frame = gr.Image(type="pil",interactive=True, elem_id="template_frame", visible=False).style(height=360)
E:\___AI\Track_Anthing\app.py:466: GradioUnusedKwargWarning: You have unused kwarg parameters in Video, please remove them: {'autosize': True}
  video_output = gr.Video(autosize=True, visible=False).style(height=360)
E:\___AI\Track_Anthing\app.py:466: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  video_output = gr.Video(autosize=True, visible=False).style(height=360)
C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\utils.py:812: UserWarning: Expected 4 arguments for function <function select_template at 0x000002430FCC5B40>, received 3.
  warnings.warn(
C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\utils.py:816: UserWarning: Expected at least 4 arguments for function <function select_template at 0x000002430FCC5B40>, received 3.
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\dophu\AppData\Roaming\Python\Python310\site-packages\ffmpy.py", line 95, in run
    self.process = subprocess.Popen(
  File "C:\Users\dophu\.conda\envs\trackany\lib\subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\dophu\.conda\envs\trackany\lib\subprocess.py", line 1456, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\___AI\Track_Anthing\app.py", line 590, in <module>
    gr.Examples(
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\helpers.py", line 58, in create_examples
    examples_obj = Examples(
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\helpers.py", line 209, in __init__
    self.processed_examples = [
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\helpers.py", line 210, in <listcomp>
    [
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\helpers.py", line 211, in <listcomp>
    component.postprocess(sample)
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\components\video.py", line 273, in postprocess
    processed_files = (self._format_video(y), None)
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\components\video.py", line 327, in _format_video
    and not processing_utils.video_is_playable(video)
  File "C:\Users\dophu\.conda\envs\trackany\lib\site-packages\gradio\processing_utils.py", line 514, in video_is_playable
    output = probe.run(stderr=subprocess.PIPE, stdout=subprocess.PIPE)
  File "C:\Users\dophu\AppData\Roaming\Python\Python310\site-packages\ffmpy.py", line 105, in run
    raise FFExecutableNotFoundError(
ffmpy.FFExecutableNotFoundError: Executable 'ffprobe' not found

Any help would be really appreciated! Again! Thank you for all of your hard work! <3

algint commented 6 months ago

换成3.9版本的gradio,因为依赖里gradio没有指定版本,pip拉取的最新,当前是4.3,会有语法上的问题

ahmadrajati commented 3 months ago

You can also install the last version of gradio and edit the app.py file. You can remove the scale parameter in gr.Row(), autosize in gr.Video(), .style() from the end of the lines that raise error, and remove the enable_queue parameter in iface.launch.

algint commented 3 months ago

 Email has been received.                  Best regards.                              ---Hui

mteixeiraTecgraf commented 2 months ago

I am facing the same issues. Anyone can help us?

algint commented 2 months ago

 Email has been received.                  Best regards.                              ---Hui

mteixeiraTecgraf commented 2 months ago

This version worked for me. gradio==3.39.0 .

I have tried this based on https://github.com/gaomingqi/Track-Anything/issues/120