Git Product home page Git Product logo

video-object-removal's Introduction

video-object-removal

Just draw a bounding box and you can remove the object you want to remove.

Installation

All the code has been tested on Ubuntu 16.04, Python 3.5, Pytorch 0.4.0, CUDA 8.0, GTX1080Ti GPU.

  • Clone the repository
git clone https://github.com/zllrunning/video-object-removal.git
cd video-object-removal
cd get_mask
bash make.sh
cd ../inpainting
bash install.sh
cd ..

Demo

  • Download pretrained models of SiamMask and Inpainting
  • Put them in cp/ folder
  • Then just run:
python demo.py --data data/Human6
  • It also supports video file.
python demo.py --data data/bag.avi
  • Another optional parameter : --mask-dilation
python demo.py --data data/Human6  --mask-dilation 24

This parameter controls the size of the dilation kernel used for the mask. The role is to expand the range of the mask to avoid edge problems. Please see inpainting/davis.py for more details.


1. Just draw a bounding box like this:

2. The objected will be removed and the inpainted video will be saved in results/inpainting folder. (The Gif image loading takes some time, please wait a moment.)

Examples

Acknowledgement

Citation

@article{Wang2019SiamMask,
    title={Fast Online Object Tracking and Segmentation: A Unifying Approach},
    author={Wang, Qiang and Zhang, Li and Bertinetto, Luca and Hu, Weiming and Torr, Philip HS},
    journal={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    year={2019}
}
@inproceedings{kim2019deep,
  title={Deep Video Inpainting},
  author={Kim, Dahun and Woo, Sanghyun and Lee, Joon-Young and So Kweon, In},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={5792--5801},
  year={2019}

video-object-removal's People

Contributors

zllrunning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video-object-removal's Issues

undefined symbol: __cudaPopCallConfiguration errror

Hello! When I try ro run demo.py ,
error "inpainting/models/correlation_package/_ext/correlation/_correlation.so: undefined symbol: __cudaPopCallConfiguration" occurs. My system cuda version is 10.0. I install pytorch 0.4.0 and cudatoolkit 9.0 in my anaconda envrionment. Could you give some suggestion on solving this problem?

Problem with install.sh, ubuntu 18.04, GPU1050, py3.6

bash install.sh
Compiling correlation kernels by nvcc...
rm: cannot remove 'correlation_cuda_kernel.o': No such file or directory
In file included from /usr/local/cuda-9.0/bin/..//include/host_config.h:50:0,
from /usr/local/cuda-9.0/bin/..//include/cuda_runtime.h:78,
from :0:
/usr/local/cuda-9.0/bin/..//include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
x86_64-linux-gnu-gcc: error: /home/vankhoa/code/video-object-removal/inpainting/lib/correlation_package/src/correlation_cuda_kernel.o: No such file or directory
Traceback (most recent call last):
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 207, in link
self.spawn(linker + ld_args)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
target_lang=language)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 209, in link
raise LinkError(msg)
distutils.errors.LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build.py", line 31, in
ffi.build()
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/recompiler.py", line 1526, in recompile
compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.VerificationError: LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Compiling resample2d kernels by nvcc...
rm: cannot remove 'Resample2d_kernel.o': No such file or directory
In file included from /usr/local/cuda-9.0/bin/..//include/host_config.h:50:0,
from /usr/local/cuda-9.0/bin/..//include/cuda_runtime.h:78,
from :0:
/usr/local/cuda-9.0/bin/..//include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
x86_64-linux-gnu-gcc: error: /home/vankhoa/code/video-object-removal/inpainting/lib/resample2d_package/src/Resample2d_kernel.o: No such file or directory
Traceback (most recent call last):
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 207, in link
self.spawn(linker + ld_args)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
target_lang=language)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 209, in link
raise LinkError(msg)
distutils.errors.LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build.py", line 31, in
ffi.build()
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/recompiler.py", line 1526, in recompile
compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.VerificationError: LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Compiling channelnorm kernels by nvcc...
rm: cannot remove 'ChannelNorm_kernel.o': No such file or directory
In file included from /usr/local/cuda-9.0/bin/..//include/host_config.h:50:0,
from /usr/local/cuda-9.0/bin/..//include/cuda_runtime.h:78,
from :0:
/usr/local/cuda-9.0/bin/..//include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
x86_64-linux-gnu-gcc: error: /home/vankhoa/code/video-object-removal/inpainting/lib/channelnorm_package/src/ChannelNorm_kernel.o: No such file or directory
Traceback (most recent call last):
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 207, in link
self.spawn(linker + ld_args)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
target_lang=language)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 209, in link
raise LinkError(msg)
distutils.errors.LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build.py", line 31, in
ffi.build()
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/recompiler.py", line 1526, in recompile
compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.VerificationError: LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Compiling correlation kernels by nvcc...
rm: cannot remove 'correlation_cuda_kernel.o': No such file or directory
In file included from /usr/local/cuda-9.0/bin/..//include/host_config.h:50:0,
from /usr/local/cuda-9.0/bin/..//include/cuda_runtime.h:78,
from :0:
/usr/local/cuda-9.0/bin/..//include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
x86_64-linux-gnu-gcc: error: /home/vankhoa/code/video-object-removal/inpainting/models/correlation_package/src/correlation_cuda_kernel.o: No such file or directory
Traceback (most recent call last):
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 207, in link
self.spawn(linker + ld_args)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 558, in build_extension
target_lang=language)
File "/usr/lib/python3.6/distutils/ccompiler.py", line 717, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
File "/usr/lib/python3.6/distutils/unixccompiler.py", line 209, in link
raise LinkError(msg)
distutils.errors.LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "build.py", line 31, in
ffi.build()
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/api.py", line 723, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/recompiler.py", line 1526, in recompile
compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/vankhoa/contrib/py36/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.VerificationError: LinkError: command 'x86_64-linux-gnu-gcc' failed with exit status 1

demo.py error

when i python demo.py, i meet an error below, is there anyone can help me?

Traceback (most recent call last):
File "demo.py", line 3, in
from inpaint import inpaint
File "/home/xiah/video-object-removal-master/inpaint.py", line 5, in
from inpainting.model import generate_model
File "/home/xiah/video-object-removal-master/inpainting/model.py", line 3, in
from inpainting.models import vinet
File "/home/xiah/video-object-removal-master/inpainting/models/vinet.py", line 6, in
from inpainting.models.flow_modules import (WarpingLayer, LongFlowNetCorr, MaskEstimator_ )
File "/home/xiah/video-object-removal-master/inpainting/models/flow_modules.py", line 7, in
from inpainting.models.correlation_package.modules.correlation import Correlation
File "/home/xiah/video-object-removal-master/inpainting/models/correlation_package/modules/correlation.py", line 3, in
from ..functions.correlation import CorrelationFunction
File "/home/xiah/video-object-removal-master/inpainting/models/correlation_package/functions/correlation.py", line 3, in
from .._ext import correlation
File "/home/xiah/video-object-removal-master/inpainting/models/correlation_package/_ext/correlation/init.py", line 3, in
from ._correlation import lib as _lib, ffi as _ffi
ImportError: /home/xiah/video-object-removal-master/inpainting/models/correlation_package/_ext/correlation/_correlation.so: undefined symbol: __cudaPopCallConfiguration

I have some error with correlation :ImportError: No module named 'inpainting.models.correlation_package._ext.correlation._correlation'

Traceback (most recent call last):
File "demo.py", line 3, in
from inpaint import inpaint
File "/media/data2/zhangpz/video-object-removal-master/inpaint.py", line 5, in
from inpainting.model import generate_model
File "/media/data2/zhangpz/video-object-removal-master/inpainting/model.py", line 3, in
from inpainting.models import vinet
File "/media/data2/zhangpz/video-object-removal-master/inpainting/models/vinet.py", line 6, in
from inpainting.models.flow_modules import (WarpingLayer, LongFlowNetCorr, MaskEstimator_ )
File "/media/data2/zhangpz/video-object-removal-master/inpainting/models/flow_modules.py", line 7, in
from inpainting.models.correlation_package.modules.correlation import Correlation
File "/media/data2/zhangpz/video-object-removal-master/inpainting/models/correlation_package/modules/correlation.py", line 3, in
from ..functions.correlation import CorrelationFunction
File "/media/data2/zhangpz/video-object-removal-master/inpainting/models/correlation_package/functions/correlation.py", line 3, in
from .._ext import correlation
File "/media/data2/zhangpz/video-object-removal-master/inpainting/models/correlation_package/_ext/correlation/init.py", line 3, in
from ._correlation import lib as _lib, ffi as _ffi
ImportError: No module named 'inpainting.models.correlation_package._ext.correlation._correlation'
I have this error. Thank you!

Is this for real time video or recorded video

I am looking for a code or software to remove objects in real time video, can someone please tell me if this code will work for real time video (live capturing video) or work for recorded video

I can't save mp4 result

After configuring the environment according to the steps, you can get the image results in the / results / data directory, but when saving as an MP4 file, the code error is as follows:
image
According to the inspection of the operating environment, the ffmpeg package already exists in the environment. I want to ask how to solve this problem?
image

from . import region

from . import region
ImportError: cannot import name 'region' from 'get_mask.utils.pyvotkit' (F:\Downloads\idm\Compressed\video-object-removal-master\video-object-removal-master\get_mask\utils\pyvotkit_init_.py)

Error when bash install.sh

when Python build.py in ./inpainting/lib/correlation_package/
TypeError:init() missing 1 required positional argument: 'dist'

Any way to install without cuda and gpu ?

I was trying to install the project using CPU only but getting some error.
So any way to install with CPU only?

Error:

Compiling correlation kernels by nvcc...
rm: cannot remove 'correlation_cuda_kernel.o': No such file or directory
./make.sh: line 11: nvcc: command not found
In file included from /home/mahbubcseju/anaconda3/envs/ML/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
                 from _correlation.c:493:
/home/mahbubcseju/anaconda3/envs/ML/lib/python3.5/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory
compilation terminated.

Error when running bash install.sh

Hello everyone, i just got the following error when running bash install.sh:

Compiling correlation kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 3, in
import torch.utils.ffi
File "/home/huan/anaconda3/envs/myenv/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling resample2d kernels by nvcc...
Resample2d_kernel.cu:1:10: fatal error: THC.h: No such file or directory
#include <THC.h>
^~~~~~~
compilation terminated.
Traceback (most recent call last):
File "build.py", line 3, in
import torch.utils.ffi
File "/home/huan/anaconda3/envs/myenv/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling channelnorm kernels by nvcc...
ChannelNorm_kernel.cu:1:10: fatal error: THC.h: No such file or directory
#include <THC.h>
^~~~~~~
compilation terminated.
Traceback (most recent call last):
File "build.py", line 3, in
import torch.utils.ffi
File "/home/huan/anaconda3/envs/myenv/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Compiling correlation kernels by nvcc...
Traceback (most recent call last):
File "build.py", line 3, in
import torch.utils.ffi
File "/home/huan/anaconda3/envs/myenv/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 1, in
raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")
ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
(myenv) huan@HuanUbt:~/video-object-removal/inpainting$

Is anyone can help me?

error in inpaint

Traceback (most recent call last):
File "demo.py", line 3, in
from inpaint import inpaint
File "E:\pytorch\video-object-removal\inpaint.py", line 5, in
from inpainting.model import generate_model
File "E:\pytorch\video-object-removal\inpainting\model.py", line 3, in
from inpainting.models import vinet
File "E:\pytorch\video-object-removal\inpainting\models\vinet.py", line 6, in
from inpainting.models.flow_modules import (WarpingLayer, LongFlowNetCorr, MaskEstimator_ )
File "E:\pytorch\video-object-removal\inpainting\models\flow_modules.py", line 7, in
from inpainting.models.correlation_package.modules.correlation import Correlation
File "E:\pytorch\video-object-removal\inpainting\models\correlation_package\modules\correlation.py", line 3, in
from ..functions.correlation import CorrelationFunction
File "E:\pytorch\video-object-removal\inpainting\models\correlation_package\functions\correlation.py", line 3, in
from .._ext import correlation
ModuleNotFoundError: No module named 'inpainting.models.correlation_package._ext'

Out of memory?

I've been learning CUDA and pytorch just so that I could run this project. (Doing so has been something of a trial by fire.)

I built my own pytorch from the repo's v0.4.0 tag, and have it running (partially) on two machines, both running Fedora Core 30: one with a Quadro P2000 with 4 GB of main memory, 5 GB of video memory, using SM 6.0, CUDA 9.1, and gcc 5.1.1, and another machine with an RTX 2060 with 32 GB of main memory, 6 GB of video memory, using SM 6.0/7.0, CUDA 9.2 (10.1 had terrible build problems with pytorch 0.4.0), and gcc 6.2.1.

Both machines can run the data/bag.avi test, but when I try to run the data/Human6 test, once it gets to the inpainting part, the RTX 2060 machine gets this:

THCudaCheck FAIL file=$(PYTORCH)/aten/src/THC/generic/THCStorage.cu line=58 error=2 : out of memory
Traceback (most recent call last):
File "demo.py", line 15, in
inpaint(args)
File "$(VOM)/inpaint.py", line 96, in inpaint
inputs = to_var(inputs)
File "$(VOM)/inpainting/utils.py", line 170, in to_var
x = x.cuda()
RuntimeError: cuda runtime error (2) : out of memory at $(PYTORCH)/aten/src/THC/generic/THCStorage.cu:58

The Quadro P2000 machine fails the inpainting part of the data/Human6 test with:

ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
Traceback (most recent call last):
File "demo.py", line 15, in
inpaint(args)
File "$(VOM)/inpaint.py", line 74, in inpaint
for seq, (inputs, masks, info) in enumerate(DTloader):
File "$(PYTORCH)/utils/data/dataloader.py", line 280, in next
idx, batch = self._get_batch()
File "$(PYTORCH)/utils/data/dataloader.py", line 259, in _get_batch
return self.data_queue.get()
File "/usr/lib64/python3.7/multiprocessing/queues.py", line 352, in get
res = self._reader.recv_bytes()
File "/usr/lib64/python3.7/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/usr/lib64/python3.7/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/usr/lib64/python3.7/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
File "$(PYTORCH)/utils/data/dataloader.py", line 178, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid

Insufficient RAM, I guess? Any insight into what part is so memory-intensive, and what could be done about it?

Assuming these problems are surmountable...do you know if the algorithm is amenable to removing something that doesn't appear in the first frame, and that fades in/out? My first intended project is to remove the credit text from this video.

Thank you for any insights into these issues!

ImportError: cannot import name 'region' from 'get_mask.utils.pyvotkit'

Traceback (most recent call last):
File "demo.py", line 2, in
from mask import mask
File "C:\Users\Admin\vor\mask.py", line 8, in
from get_mask.test import *
File "C:\Users\Admin\vor\get_mask\test.py", line 30, in
from get_mask.utils.pyvotkit.region import vot_overlap, vot_float2str
File "C:\Users\Admin\vor\get_mask\utils\pyvotkit_init_.py", line 9, in
from . import region
ImportError: cannot import name 'region' from 'get_mask.utils.pyvotkit' (C:\Users\Admin\vor\get_mask\utils\pyvotkit_init_.py)

ImportError: No module named inpainting.davis

How do I fix this error I am getting?

:~/video-object-removal$ python demo.py --data /home/user/Desktop/VID_151890412_145812_234.mp4
Traceback (most recent call last):
File "demo.py", line 3, in
from inpaint import inpaint
File "/home/user/video-object-removal/inpaint.py", line 4, in
from inpainting.davis import DAVIS
ImportError: No module named inpainting.davis

License?

Excellent work here. I am confused about the licensing implications though. Would help if you could clarify if this can be used commercially?

Thanks!

Error in python library parso while running demo.py

Traceback (most recent call last):
File "demo.py", line 3, in
from inpaint import inpaint
File "/content/video-object-removal/inpaint.py", line 4, in
from inpainting.davis import DAVIS
File "/content/video-object-removal/inpainting/davis.py", line 7, in
import matplotlib.pyplot as plt
File "/usr/local/envs/task/lib/python3.5/site-packages/matplotlib/pyplot.py", line 2371, in
switch_backend(rcParams["backend"])
File "/usr/local/envs/task/lib/python3.5/site-packages/matplotlib/pyplot.py", line 207, in switch_backend
backend_mod = importlib.import_module(backend_name)
File "/usr/local/envs/task/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/envs/task/lib/python3.5/site-packages/ipykernel/init.py", line 2, in
from .connect import *
File "/usr/local/envs/task/lib/python3.5/site-packages/ipykernel/connect.py", line 13, in
from IPython.core.profiledir import ProfileDir
File "/usr/local/envs/task/lib/python3.5/site-packages/IPython/init.py", line 55, in
from .terminal.embed import embed
File "/usr/local/envs/task/lib/python3.5/site-packages/IPython/terminal/embed.py", line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/usr/local/envs/task/lib/python3.5/site-packages/IPython/terminal/interactiveshell.py", line 32, in
from .debugger import TerminalPdb, Pdb
File "/usr/local/envs/task/lib/python3.5/site-packages/IPython/terminal/debugger.py", line 6, in
from IPython.core.completer import IPCompleter
File "/usr/local/envs/task/lib/python3.5/site-packages/IPython/core/completer.py", line 146, in
import jedi
File "/usr/local/envs/task/lib/python3.5/site-packages/jedi/init.py", line 41, in
from jedi.api import Script, Interpreter, set_debug_function,
File "/usr/local/envs/task/lib/python3.5/site-packages/jedi/api/init.py", line 15, in
import parso
File "/usr/local/envs/task/lib/python3.5/site-packages/parso/init.py", line 41, in
from parso.parser import ParserSyntaxError
File "/usr/local/envs/task/lib/python3.5/site-packages/parso/parser.py", line 113
node_map: Dict[str, type] = {}
^
SyntaxError: invalid syntax

undefined symbol: __cudaRegisterFatBinaryEnd if run demo.py

Hello! When I try ro run demo.py , i obtain an error

Traceback (most recent call last):
File "demo.py", line 3, in
from inpaint import inpaint
File "/content/video-object-removal/inpaint.py", line 5, in
from inpainting.model import generate_model
File "/content/video-object-removal/inpainting/model.py", line 3, in
from inpainting.models import vinet
File "/content/video-object-removal/inpainting/models/vinet.py", line 6, in
from inpainting.models.flow_modules import (WarpingLayer, LongFlowNetCorr, MaskEstimator_ )
File "/content/video-object-removal/inpainting/models/flow_modules.py", line 7, in
from inpainting.models.correlation_package.modules.correlation import Correlation
File "/content/video-object-removal/inpainting/models/correlation_package/modules/correlation.py", line 3, in
from ..functions.correlation import CorrelationFunction
File "/content/video-object-removal/inpainting/models/correlation_package/functions/correlation.py", line 3, in
from .._ext import correlation
File "/content/video-object-removal/inpainting/models/correlation_package/_ext/correlation/init.py", line 3, in
from ._correlation import lib as _lib, ffi as _ffi
ImportError: /content/video-object-removal/inpainting/models/correlation_package/_ext/correlation/_correlation.so: undefined symbol: __cudaRegisterFatBinaryEnd

core dumped error

I don't know whether some other people meet the similar problem, it seems that there are some bugs in the code.

the error like this:

run.sh: line 1: 97 Segmentation fault (core dumped) python demo.py --data data/bag.avi

Couldn't open the .gif images and Videos

As I mentioned I can't overcome to upload .gif images and videos in the project. Whenever I upload the file in the project it Only shows blank White square boxes in place of Images and videos...
And whenever I click on it ,It shows "Couldn't resolve file over 10 MB. So how to Overcome this issue.....Please help me

Where is the requirements.txt file?

I couldn't run the demo because there is no explicit dependency available on the machine, could you define those on requirements.txt?

You could just execute pip freeze >> requirements.txt to build that.

./make.sh: Permission denied

now, my pytorh is 0.4.0, but there are some error when I bash install.sh.

install.sh: line 3: ./make.sh: Permission denied
install.sh: line 5: ./make.sh: Permission denied
install.sh: line 7: ./make.sh: Permission denied
install.sh: line 9: ./make.sh: Permission denied

I have a problem with importing torch

sorry I'm new here, can anybody help?

Traceback (most recent call last):
File "demo.py", line 2, in
from mask import mask
File "C:\Users\Jade\video-object-removal\mask.py", line 8, in
from get_mask.test import *
File "C:\Users\Jade\video-object-removal\get_mask\test.py", line 16, in
from get_mask.utils.load_helper import load_pretrain
File "C:\Users\Jade\video-object-removal\get_mask\utils\load_helper.py", line 1, in
import torch
ModuleNotFoundError: No module named 'torch'

Error when running make.sh

When I run bash make.sh during the installation, I get the following error:

Traceback (most recent call last):
File "setup.py", line 11, in
from Cython.Build import cythonize
ImportError: No module named Cython.Build
Traceback (most recent call last):
File "setup.py", line 11, in
from Cython.Build import cythonize
ImportError: No module named Cython.Build
P-CG09-ML3:get_mask user$ which cython
P-CG09-ML3:get_mask user$ bash make.sh
Traceback (most recent call last):
File "setup.py", line 11, in
from Cython.Build import cythonize
ImportError: No module named Cython.Build
Traceback (most recent call last):
File "setup.py", line 11, in
from Cython.Build import cythonize
ImportError: No module named Cython.Build

I have cython installed. My machine is a Mac, running Mojave 10.14.6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.