menghao666 / hdr Goto Github PK
View Code? Open in Web Editor NEWOfficial code and data for HDR ( ECCV 2022)
License: Other
Official code and data for HDR ( ECCV 2022)
License: Other
Dear author,
I have encountered an error when I try to call the segmentation network. I sincerely need your help, thank you!
import sys
sys.path.insert(0,'/mnt/workspace/project/2022AW/09/HDR/')
import numpy as np
import cv2
from utils.preprocessing import process_bbox, generate_patch_image
from PIL import Image
from mmseg.apis import inference_segmentor, init_segmentor
import matplotlib.pyplot as plt
%matplotlib inline
# segmentor
seg_cfg_file = "./configs/segformer/segformer_mit-b5_256x256_interhand_1101.py"
seg_model = init_segmentor(
config=seg_cfg_file,
checkpoint='./demo_work_dirs/Interhand_seg/iter_237500.pth',
)
Error
/mnt/workspace/project/2022AW/09/HDR/mmseg/models/backbones/mit.py:311: UserWarning: DeprecationWarning: pretrained is a deprecated, please use "init_cfg" instead
warnings.warn('DeprecationWarning: pretrained is a deprecated, '
Use load_from_local loader
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-6-db1a521dfe39> in <module>
3 seg_model = init_segmentor(
4 config=seg_cfg_file,
----> 5 checkpoint='./demo_work_dirs/Interhand_seg/iter_237500.pth',
6 )
/mnt/workspace/project/2022AW/09/HDR/mmseg/apis/inference.py in init_segmentor(config, checkpoint, device)
33 model = build_segmentor(config.model, test_cfg=config.get('test_cfg'))
34 if checkpoint is not None:
---> 35 checkpoint = load_checkpoint(model, checkpoint, map_location='cpu')
36 model.CLASSES = checkpoint['meta']['CLASSES']
37 model.PALETTE = checkpoint['meta']['PALETTE']
/home/pai/lib/python3.6/site-packages/mmcv/runner/checkpoint.py in load_checkpoint(model, filename, map_location, strict, logger, revise_keys)
525 dict or OrderedDict: The loaded checkpoint.
526 """
--> 527 checkpoint = _load_checkpoint(filename, map_location, logger)
528 # OrderedDict is a subclass of dict
529 if not isinstance(checkpoint, dict):
/home/pai/lib/python3.6/site-packages/mmcv/runner/checkpoint.py in _load_checkpoint(filename, map_location, logger)
464 information, which depends on the checkpoint.
465 """
--> 466 return CheckpointLoader.load_checkpoint(filename, map_location, logger)
467
468
/home/pai/lib/python3.6/site-packages/mmcv/runner/checkpoint.py in load_checkpoint(cls, filename, map_location, logger)
242 class_name = checkpoint_loader.__name__
243 mmcv.print_log(f'Use {class_name} loader', logger)
--> 244 return checkpoint_loader(filename, map_location)
245
246
/home/pai/lib/python3.6/site-packages/mmcv/runner/checkpoint.py in load_from_local(filename, map_location)
259 if not osp.isfile(filename):
260 raise IOError(f'{filename} is not a checkpoint file')
--> 261 checkpoint = torch.load(filename, map_location=map_location)
262 return checkpoint
263
/home/pai/lib/python3.6/site-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
598 # reset back to the original position.
599 orig_position = opened_file.tell()
--> 600 with _open_zipfile_reader(opened_file) as opened_zipfile:
601 if _is_torchscript_zip(opened_zipfile):
602 warnings.warn("'torch.load' received a zip file that looks like a TorchScript archive"
/home/pai/lib/python3.6/site-packages/torch/serialization.py in __init__(self, name_or_buffer)
240 class _open_zipfile_reader(_opener):
241 def __init__(self, name_or_buffer) -> None:
--> 242 super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
243
244
RuntimeError: PytorchStreamReader failed reading zip archive: invalid header or archive is corrupted
I am replacing Tzionas_ Dataset-02-1-rgb-100.png took a picture of my own crossed hands, but the effect was not good after running. May I ask if it is related to Tzionas_ Dataset-02-1-joints_ 2D_ Is GT-100.txt related to this file? Please provide guidance.
Hi,
Thank you for producing such amazing work for the community. Can we get the training and testing scripts soon?
Thank you!
Thank you for your great work and look forward to the release of your training code!
Whether the pre-trained model is the model of the results in the paper
Thank you for open sourcing the code, it's a really interesting job.
Thanks for open sourcing Google Drive pretrained models.
Does this pre-training model correspond to the experimental results in the paper? Or just a demo model, not the SOTA model in the paper?
Thanks!
Hello, how do I perform a real-time test?
OSError: ./dome_work_dirs/Interhand_seg/iter_237500.pth is not a checkpoint file
Very interesting job. Can you open source the code for generating amodal InterHand (AIH) Dataset? I will be very grateful!
Hi,I'm a student and very interested in your "3D Interacting Hand Pose Estimation by Hand De-occlusion and Removal" paper.
i'm getting error on running demo.py
(hdr_hope) C:\HDR>python demo/demo.py
load checkpoint from local path: ./demo_work_dirs/Interhand_seg/iter_237500.pth => loading checkpoint './demo_work_dirs/TDR_fintune/checkpoints\ckpt_iter_138000.pth.tar' => loading checkpoint './demo_work_dirs/All_train_SingleRightHand\checkpoints\ckpt_iter_261000.pth.tar' img.shape= torch.Size([1, 3, 256, 256]) Traceback (most recent call last): File "demo/demo.py", line 163, in <module> seg_result = inference_segmentor(seg_model, rgb.cuda()) File "C:\HDR\mmseg\apis\inference.py", line 168, in inference_segmentor seg_logits = model.encode_decode(img, None) File "C:\HDR\mmseg\models\segmentors\encoder_decoder.py", line 77, in encode_decode x = self.extract_feat(img) File "C:\HDR\mmseg\models\segmentors\encoder_decoder.py", line 73, in extract_feat return x UnboundLocalError: local variable 'x' referenced before assignment
i think maybe the problem is in "extract_feat" so i also post it on here
def extract_feat(self, img): """Extract features from images.""" # print(self.backbone(img)) # print(img) try: x = self.backbone(img) except : print("img.shape=", img.shape) if self.with_neck: x = self.neck(self.backbone(img))
Thank you for the good research.
According to the paper, you said you pre-train SegFormer, but did you use only two hand images except one hand image on the Interhand 2.6M dataset?
Thank you for your perfect work. I would like to test on my own image, so how could I get the 2D GT (.txt) for my own image?
Thx~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.