Пример #1
0
 def __iter__(self):
     return iter([
         DatasetItem(id='a/b/1', subset='a', annotations=[
             Bbox(2, 3, 4, 5, label=2,
                 id=1, group=1, attributes={
                     'truncated': True,
                     'difficult': False,
                     'occluded': False,
                     # no attributes here in the label categories
                 }
             ),
             Bbox(5, 4, 3, 2, label=self._label('person'),
                 id=2, group=2, attributes={
                     'truncated': True,
                     'difficult': False,
                     'occluded': False,
                     VOC.VocAction(1).name: True,
                     VOC.VocAction(2).name: True,
                     **{
                         a.name: False for a in VOC.VocAction
                             if a.value not in {1, 2}
                     }
                 }
             ),
         ]),
     ])
Пример #2
0
 def __iter__(self):
     return iter([
         DatasetItem(id='a/b/1',
                     subset='a',
                     annotations=[
                         Bbox(2,
                              3,
                              4,
                              5,
                              label=2,
                              attributes={
                                  'truncated': True,
                                  VOC.VocAction(1).name: True,
                                  VOC.VocAction(2).name: True,
                              }),
                         Bbox(5,
                              4,
                              3,
                              2,
                              label=self._label('person'),
                              attributes={
                                  'truncated': True,
                                  VOC.VocAction(1).name: True,
                                  VOC.VocAction(2).name: True,
                              }),
                     ]),
     ])