plemeri / transparent-background

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

using a local .pth returns error #60

Closed wilfrediscoming closed 3 months ago

wilfrediscoming commented 3 months ago
from transparent_background import Remover

# Load remover model
remover = Remover(device="cuda:0", ckpt='/content/latest_v2.pth')

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-1-9234ebeb83b8>](https://localhost:8080/#) in <cell line: 4>()
      2 
      3 # Load remover model
----> 4 remover = Remover(device="cuda:0", ckpt='/content/latest_v2.pth')

2 frames
[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in __init__(self, name_or_buffer)
    455 class _open_zipfile_reader(_opener):
    456     def __init__(self, name_or_buffer) -> None:
--> 457         super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
    458 
    459 

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
wilfrediscoming commented 3 months ago

@plemeri btw, originally if we don't state a local.pth, it downloads from your google drive and sometimes it failed (because too many downloads)

is it still the case now?

plemeri commented 3 months ago

Hi @wilfrediscoming, I moved from google drive to github release, so it is not a problem anymore and I tested myself last week. After some googling, your checkpoint latest_v2.pth seems corrupted. Please check if it is valid.

wwwtxhy commented 3 months ago

[transparent-background],using a local。 Hello friend, can you specify object names to execute? When there are multiple objects in picture and I want to block out some objects, for example, there is a small dog next to me but I don't need it to show. I seem to not be able to find this step in the instructions, thank you!

wilfrediscoming commented 3 months ago

@wwwtxhy You can try some image dectection library, but I am not sure if it fits your use case.

If you don't want a dog to show next to you, you can use inpainting to erase the dog, and any objects that you don't want.

wilfrediscoming commented 3 months ago

@plemeri Thanks for letting me know, then I don't have to download from my own google drive anymore. Cheers! 👍