Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the pair_id for each items ? #4

Closed
lamhoangtung opened this issue May 29, 2019 · 3 comments
Closed

What is the pair_id for each items ? #4

lamhoangtung opened this issue May 29, 2019 · 3 comments

Comments

@lamhoangtung
Copy link

I'm trying to work with the dataset, let's say I have this annotation file

{
  'item2': {
    'segmentation': [
      [1, 2, 1, 17, 94, 58, 128, 2, 163, 2, 180, 86, 203, 173, 370, 149, 490, 81, 463, 1, 1, 2],
      [1, 2, 1, 17, 94, 58, 128, 2, 1, 2]
    ],
    'scale': 2,
    'viewpoint': 2,
    'zoom_in': 3,
    'landmarks': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 58, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 86, 2, 203, 173, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    'style': 0,
    'bounding_box': [0, 0, 495, 179],
    'category_id': 1,
    'occlusion': 1,
    'category_name': 'short sleeve top'
  },
  'source': 'shop',
  'pair_id': 1811,
  'item1': {
    'segmentation': [
      [237, 160, 378, 153, 461, 92, 519, 214, 535, 348, 440, 428, 292, 420, 247, 309, 237, 160]
    ],
    'scale': 2,
    'viewpoint': 2,
    'zoom_in': 1,
    'landmarks': [237, 160, 1, 378, 153, 2, 461, 92, 1, 247, 309, 2, 292, 420, 2, 440, 428, 2, 535, 348, 2, 519, 214, 2],
    'style': 1,
    'bounding_box': [227, 86, 543, 455],
    'category_id': 9,
    'occlusion': 2,
    'category_name': 'skirt'
  }
}

Which pair_id will belong to which items? There are many cases when I saw 5,6 item in an image, it's really confusing to find the correct pair_id with the correct item.

Hope you can clarify this for me. Thanks

@geyuying
Copy link
Collaborator

Please note that we do not provide data in pairs. In training dataset, images are organized with continuous 'pair_id' including images from consumers and images from shops. (For example: 000001.jpg(pair_id:1; from consumer), 000002.jpg(pair_id:1; from shop),000003.jpg(pair_id:2; from consumer),000004.jpg(pair_id:2; from consumer),000005.jpg(pair_id:2; from consumer), 000006.jpg(pair_id:2; from consumer),000007.jpg(pair_id:2; from shop),000008.jpg(pair_id:2; from shop)...) A clothing item from shop images and a clothing item from consumer image are positive commercial-consumer pair if they have the same style number which is greater than 0 and they are from images with the same pair id, otherwise they are negative pairs. In this way, you can consruct training positive pairs and negative pairs in instance-level.

As is shown in the figure below, the first three images are from consumers and the last two images are from shops. These five images have the same 'pair_id'. Clothing items in orange bounding box have the same 'style':1. Clothing items in green bounding box have the same 'style': 2. 'Style' of other clothing items whose bouding boxes are not drawn in the figure is 0 and they can not construct positive commercial-consumer pairs. One positive commercial-consumer pair is the annotated short sleeve top in the first image and the annotated short sleeve top in the last image. Our dataset makes it possbile to construct instance-level pairs in a flexible way.
https://github.com/switchablenorms/DeepFashion2/blob/master/images/pair.jpg

Hope the above explanation will be helpful.

@geyuying
Copy link
Collaborator

'pair_id' and 'style' makes it convenient to construct instance-level pairs. 'pair_id' is an image-level label and 'style' is an instance-level label. All items in an image share the same 'pair_id'.

@lamhoangtung
Copy link
Author

Thank you @geyuying for the clarification. If anyone wanna create item_id for each item, <pair_id>_<style> might be a good format :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants