plemeri / transparent-background

This is a background removing tool powered by InSPyReNet (ACCV 2022)
MIT License
777 stars 86 forks source link

How do you use it in real-time? #15

Closed notBradPitt closed 1 year ago

notBradPitt commented 1 year ago

I'm running transparent-background on Windows with OBS installed and I'm still not sure what I'm supposed to get the real-time preview working. I tried the following command transparent-background --source 0 and it seems to result an error because I didn't specify the output path

Settings -> Mode=base, Device=cpu, Torchscript=disabled
[ WARN:0@6.244] global cap_msmf.cpp:471 `anonymous-namespace'::SourceReaderCB::OnReadSample videoio(MSMF): OnReadSample() is called with error status: -1072875772
[ WARN:0@6.294] global cap_msmf.cpp:483 `anonymous-namespace'::SourceReaderCB::OnReadSample videoio(MSMF): async ReadSample() call is failed with error status: -1072875772
[ WARN:1@6.304] global cap_msmf.cpp:1759 CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -1072875772
[ WARN:2@6.313] global cap_msmf.cpp:1759 CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -1072875772
                 0%|                                                  | 0/0 [00:00<?, ?it/s]Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Programs\Miniconda3\envs\py311\Scripts\transparent-background.exe\__main__.py", line 7, in <module>
  File "D:\Programs\Miniconda3\envs\py311\Lib\site-packages\transparent_background\Remover.py", line 232, in console
    print('\nDone. Results are saved in {}'.format(os.path.abspath(save_dir)))
                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen ntpath>", line 573, in abspath
  File "<frozen ntpath>", line 540, in normpath
TypeError: expected str, bytes or os.PathLike object, not NoneType

Another error

100%|███████████████████████████████████████████████████████████████████████████████| 368M/368M [02:21<00:00, 2.59MB/s]
Settings -> Mode=fast, Device=cpu, Torchscript=disabled
None:            0%|                                                  | 0/0 [00:00<?, ?it/s]Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Programs\Miniconda3\envs\py311\Scripts\transparent-background.exe\__main__.py", line 7, in <module>
  File "D:\Programs\Miniconda3\envs\py311\Lib\site-packages\transparent_background\Remover.py", line 202, in console
    outname = '{}_{}'.format(os.path.splitext(name)[0], args.type)
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen ntpath>", line 232, in splitext
TypeError: expected str, bytes or os.PathLike object, not NoneType
plemeri commented 1 year ago

Hi @notBradPitt, I'm sorry but I currently have no windows machine available for now. Let me find any machine left and fix this issue.