Giter Site home page Giter Site logo

charleshhy / one-shot-human-parsing Goto Github PK

View Code? Open in Web Editor NEW
71.0 71.0 8.0 758 KB

[AAAI 2021] (oral) Progressive One-shot Human Parsing, [TPAMI 2023] End-to-end One-shot Human Parsing

License: Apache License 2.0

Python 97.96% Shell 2.04%
benchmark few-shot-segmentation human-parsing virtual-tryon

one-shot-human-parsing's People

Contributors

charleshhy avatar woo1 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

Watchers

 avatar  avatar  avatar

one-shot-human-parsing's Issues

ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory

When I am running the project from the following command:

bash scripts/evaluate_atr_kwf1.sh

I am getting the following error:

Traceback (most recent call last):
  File "./exp/train.py", line 14, in <module>
    from torchvision import transforms
  File "/home/mayank/anaconda3/envs/iniy_oneshothumanparsing_041221/lib/python3.7/site-packages/torchvision/__init__.py", line 1, in <module>
    from torchvision import models
  File "/home/mayank/anaconda3/envs/iniy_oneshothumanparsing_041221/lib/python3.7/site-packages/torchvision/models/__init__.py", line 11, in <module>
    from . import detection
  File "/home/mayank/anaconda3/envs/iniy_oneshothumanparsing_041221/lib/python3.7/site-packages/torchvision/models/detection/__init__.py", line 1, in <module>
    from .faster_rcnn import *
  File "/home/mayank/anaconda3/envs/iniy_oneshothumanparsing_041221/lib/python3.7/site-packages/torchvision/models/detection/faster_rcnn.py", line 7, in <module>
    from torchvision.ops import misc as misc_nn_ops
  File "/home/mayank/anaconda3/envs/iniy_oneshothumanparsing_041221/lib/python3.7/site-packages/torchvision/ops/__init__.py", line 1, in <module>
    from .boxes import nms, box_iou
  File "/home/mayank/anaconda3/envs/iniy_oneshothumanparsing_041221/lib/python3.7/site-packages/torchvision/ops/boxes.py", line 2, in <module>
    from torchvision import _C
ImportError: libcudart.so.9.0: cannot open shared object file: No such file or directory

This is the structure of the project:

.
├── data
│   ├── datasets
│   │   ├── ATR_OS
│   │   │   ├── list
│   │   │   │   ├── meta_test_id.txt
│   │   │   │   └── meta_train_id.txt
│   │   │   └── support
│   │   │       ├── meta_test_atr_supports.pkl
│   │   │       └── meta_train_atr_supports.pkl
│   │   ├── CIHP_OS
│   │   │   └── list
│   │   │       ├── meta_test_id.txt
│   │   │       └── meta_train_id.txt
│   │   └── LIP_OS
│   │       └── list
│   │           ├── meta_test_id.txt
│   │           └── meta_train_id.txt
│   └── pretrained_model
│       └── deeplab_v3plus_v3.pth
├── dataloaders
│   ├── mypath_atr.py
│   ├── mypath_mhp.py
│   ├── mypath.py
│   ├── oshp_loader.py
│   └── transforms.py
├── exp
│   ├── __init__.py
│   └── train.py
├── how_to_install.txt
├── imgs
│   ├── Figure1.jpg
│   └── Figure1.pdf
├── LICENSE
├── networks
│   ├── deeplab_xception_synBN.py
│   ├── eopnet.py
│   ├── __init__.py
│   └── popnet.py
├── README.md
├── requirements.txt
├── scripts
│   ├── atr_eop_1wf1.sh
│   ├── atr_eop_1wf2.sh
│   ├── atr_eop_kwf1.sh
│   ├── atr_eop_kwf2.sh
│   ├── cihp_eop_kwf1.sh
│   ├── cihp_eop_kwf2.sh
│   ├── evaluate_atr_1wf1.sh
│   ├── evaluate_atr_kwf1.sh
│   ├── lip_etop_kw_f1.sh
│   └── lip_etop_kw_f2.sh
├── sync_batchnorm
│   ├── batchnorm.py
│   ├── comm.py
│   ├── __init__.py
│   ├── replicate.py
│   └── unittest.py
└── utils
    ├── __init__.py
    ├── metric.py
    ├── sampler.py
    ├── test_human.py
    └── util.py

Please help me.

Download dataset

Hello, I am running the project recently. I hope you can provide it. Please pass the application. My account number is [email protected] Thank you very much.

How to do inference? Code Example?

I am not getting how to do inference using this code? I see no example code, no script regarding inference. It makes me think it is only possible to do training with this code?

I found this exact same issue that got an answer, unfortunately the answer do not actually answers the questions, as it redirects to a util function that saves the image as a file and suppose you already did inference and got the prediction.

#9

Can you please provide an example code to do inference?
If I have an image "input/person.jpg", what do I do to get the human parse as a result?

Thank you,

some questions about metrics

I successfully reproduced your code on the atr dataset, but the effect did not reach the effect mentioned in your article, as shown in the figure below, epoch=50, batch=2, gpus=2, because batch=2 will report an error, I made a simple modification to the code, what else can I do to achieve the effect of your article. Also, which part of the code output should I look at, agm or npm, where mean miou is the human miou in the paper?
Looking forward to your reply!

Inference using pretrained models

Hi,
first of all, thanks a lot for sharing your work. Really impressive!
I have 2 questions please:

  1. I am not sure if I get the purpose/capabilities of this approach correctly but, is the model able to handle one single input image at inference time? e.g. during training it seems that both query and support images/masks are needed. For inference, what we want though, is to be able to submit a single (or batch) picture of a person and have the mask as output (image IN -> mask OUT). Is this supported?
  2. If yes, do you have a code snippet providing preprocessing+inference+postprocessing?

Thanks and have a great day

size mismatch for prototype

bash scripts/evaluate_atr_kwf1.sh

the content of evaluate_atr_kwf1.sh:
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
python ./exp/train.py
--batch 2
--gpus 1
--resume_model ./data/pretrained_model/atr_kwf1.pth
--resume_epoch 39
--lr 0.001
--numworker 6
--testInterval 10
--hidden_layers 256
--epochs 50
--dataset atr
--test_classes 18
--fold 1
--way 'kway'
--structure kway_oshp
--size 512
--prototype_warmup 25
--fg_weight 1.0
--contrast_weight 1.0
--testing_screening
--feature_lvl mid
--temperature 0.1
--validate

result:
=> Structure:kway_oshp, dataset:atr, way:kway, fold:1
=> Saving log to: /home/fuzhi-dlj/workspace_big_bang/workspace/infant/human_parse/One-shot-Human-Parsing/exp/run_cihp/run_6
Constructing DeepLabv3+ model...
Output stride: 16
Number of Input Channels: 3
=> No model load!
opts.resume_model ./data/pretrained_model/atr_kwf1.pth
Traceback (most recent call last):
File "./exp/train.py", line 560, in
main(opts)
File "./exp/train.py", line 381, in main
net_.load_state_dict(x)
File "/home/fuzhi-dlj/workspace/conda_list/pyt1736/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1052, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for EOPNet_kway:
size mismatch for prototype: copying a param with shape torch.Size([20, 256]) from checkpoint, the shape in current model is torch.Size([18, 256]).

Data sets usage license

Hello
Thanks for the awesome work

In the README, there are link to datasets that can be downloaded via google drive, can you specify what are the licenses for using these datasets

b.r

example of inference

Can you provide a simply script to get the visualization result? thanks you!

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.