VlSomers / bpbreid

[WACV23] A strong baseline for body part-based person re-identification
Other
153 stars 16 forks source link

Simple demo #26

Open su850131 opened 11 months ago

su850131 commented 11 months ago

Hi, Can you provide a simple demo? input 2 image and 2 mask, output all distances. Thank you!

VlSomers commented 11 months ago

Hi @su850131, you are right that this repository needs a simple demo like this. However it will require some time to do something nice and I'm very busy right now. I will provide a demo in late November when I will have more time. In the meantime, you can have a look at issue #27 for tips to achieve this.

su850131 commented 11 months ago

OK, I will look at issue #27, thank you for your help. I’m looking forward to your demo!

mrsadeghi commented 8 months ago

Hi, thank you for your great job Honestly, I am also waiting for your simple demo. When I run your mentioned example in the main/torchreid/tools/feature_extractor.py file

Examples::

        from torchreid.utils import FeatureExtractor

        extractor = FeatureExtractor(
            model_name='osnet_x1_0',
            model_path='a/b/c/model.pth.tar',
            device='cuda'
        )

        image_list = [
            'a/b/c/image001.jpg',
            'a/b/c/image002.jpg',
            'a/b/c/image003.jpg',
            'a/b/c/image004.jpg',
            'a/b/c/image005.jpg'
        ]

        features = extractor(image_list)
        print(features.shape) # output (5, 512)

I got this error:

ImportError: cannot import name 'FeatureExtractor' from 'torchreid.utils'

erictan23 commented 5 months ago

Hi, thank you for your great job Honestly, I am also waiting for your simple demo. When I run your mentioned example in the main/torchreid/tools/feature_extractor.py file

Examples::

        from torchreid.utils import FeatureExtractor

        extractor = FeatureExtractor(
            model_name='osnet_x1_0',
            model_path='a/b/c/model.pth.tar',
            device='cuda'
        )

        image_list = [
            'a/b/c/image001.jpg',
            'a/b/c/image002.jpg',
            'a/b/c/image003.jpg',
            'a/b/c/image004.jpg',
            'a/b/c/image005.jpg'
        ]

        features = extractor(image_list)
        print(features.shape) # output (5, 512)

I got this error:

ImportError: cannot import name 'FeatureExtractor' from 'torchreid.utils'

Its probably because there is no such module in torchreid.utils, try this instead, from torchreid.tools.feature_extractor import FeatureExtractor

Nas-Azzam commented 5 months ago

Hi, thank you for your great job Honestly, I am also waiting for your simple demo. When I run your mentioned example in the main/torchreid/tools/feature_extractor.py file

Examples::

        from torchreid.utils import FeatureExtractor

        extractor = FeatureExtractor(
            model_name='osnet_x1_0',
            model_path='a/b/c/model.pth.tar',
            device='cuda'
        )

        image_list = [
            'a/b/c/image001.jpg',
            'a/b/c/image002.jpg',
            'a/b/c/image003.jpg',
            'a/b/c/image004.jpg',
            'a/b/c/image005.jpg'
        ]

        features = extractor(image_list)
        print(features.shape) # output (5, 512)

I got this error: ImportError: cannot import name 'FeatureExtractor' from 'torchreid.utils'

Its probably because there is no such module in torchreid.utils, try this instead, from torchreid.tools.feature_extractor import FeatureExtractor

You can import "torchreid.reid.utils" I found it in env site-packages, have this structure torchreid>reid>model,utils etc.