Commit c92de52a authored by André Anjos's avatar André Anjos 💬
Browse files

[database] Create 'cvpr14' protocol

parent 83cb8b5f
......@@ -22,11 +22,26 @@ class Database(object):
self.metadata = [row for row in reader]
def objects(self):
def objects(self, protocol=None):
"""Returns a list of unique :py:class:`.File` objects for the specific
query by the user.
Returns: A list of :py:class:`.File` objects.
Parameters:
protocol (str, optional): If set, can take the value of 'cvpr14',
which subselects samples used by Li et al. on their CVPR'14 paper for
heart-rate estimation.
Returns: A list of :py:class:`File` objects.
"""
if protocol in ('cvpr14',):
d = resource_filename(__name__, os.path.join('data', 'li_samples_cvpr14.txt'))
with open(d, 'rt') as f: sessions = f.read().split()
return [File(**k) for k in self.metadata if k['basedir'] in sessions]
else:
raise RuntimeError('Protocol should be either "cvpr14" or not set. The value %s is not valid' % protocol)
return [File(**k) for k in self.metadata]
Sessions/34
Sessions/3512
Sessions/3514
Sessions/3516
Sessions/3518
Sessions/3520
Sessions/3522
Sessions/2770
Sessions/278
Sessions/280
Sessions/282
Sessions/284
Sessions/2862
Sessions/2864
Sessions/2866
Sessions/2868
Sessions/286
Sessions/2870
Sessions/2480
Sessions/2482
Sessions/2484
Sessions/2486
Sessions/2488
Sessions/2490
Sessions/2492
Sessions/2494
Sessions/2496
Sessions/2498
Sessions/24
Sessions/2236
Sessions/2238
Sessions/2240
Sessions/2242
Sessions/2244
Sessions/2246
Sessions/2248
Sessions/2250
Sessions/22
Sessions/2342
Sessions/2344
Sessions/3810
Sessions/38
Sessions/392
Sessions/394
Sessions/396
Sessions/398
Sessions/400
Sessions/402
Sessions/404
Sessions/406
Sessions/408
Sessions/2346
Sessions/2348
Sessions/2350
Sessions/2352
Sessions/2354
Sessions/2356
Sessions/2358
Sessions/2360
Sessions/2362
Sessions/2364
Sessions/2366
Sessions/2614
Sessions/2616
Sessions/2618
Sessions/2620
Sessions/2622
Sessions/2624
Sessions/2626
Sessions/2628
Sessions/262
Sessions/148
Sessions/14
Sessions/150
Sessions/152
Sessions/154
Sessions/1562
Sessions/1564
Sessions/1566
Sessions/1568
Sessions/1962
Sessions/1964
Sessions/1966
Sessions/1968
Sessions/1970
Sessions/1972
Sessions/1974
Sessions/1976
Sessions/1978
Sessions/1980
Sessions/1982
Sessions/560
Sessions/652
Sessions/654
Sessions/656
Sessions/658
Sessions/660
Sessions/662
Sessions/664
Sessions/666
Sessions/1722
Sessions/1724
Sessions/1726
Sessions/1728
Sessions/1730
Sessions/18
Sessions/1952
Sessions/1954
Sessions/1956
Sessions/1958
Sessions/1960
Sessions/2082
Sessions/2084
Sessions/2086
Sessions/2088
Sessions/2090
Sessions/2092
Sessions/2094
Sessions/2096
Sessions/2098
Sessions/20
Sessions/2100
Sessions/3390
Sessions/3392
Sessions/3394
Sessions/3396
Sessions/3398
Sessions/3400
Sessions/538
Sessions/540
Sessions/542
Sessions/544
Sessions/546
Sessions/548
Sessions/550
Sessions/552
Sessions/554
Sessions/556
Sessions/558
Sessions/1188
Sessions/1190
Sessions/1192
Sessions/1194
Sessions/1196
Sessions/1198
Sessions/1200
Sessions/1202
Sessions/1204
Sessions/1206
Sessions/1208
Sessions/3662
Sessions/3664
Sessions/3666
Sessions/3668
Sessions/3670
Sessions/3672
Sessions/3674
Sessions/3676
Sessions/3678
Sessions/3680
Sessions/36
Sessions/272
Sessions/2732
Sessions/2734
Sessions/2736
Sessions/2738
Sessions/2740
Sessions/2742
Sessions/2744
Sessions/2746
Sessions/2748
Sessions/274
Sessions/3128
Sessions/3130
Sessions/3132
Sessions/3134
Sessions/3136
Sessions/3138
Sessions/3140
Sessions/3142
Sessions/3144
Sessions/3146
Sessions/3148
Sessions/3524
Sessions/3526
Sessions/3528
Sessions/3530
Sessions/3532
Sessions/3534
Sessions/3536
Sessions/3538
Sessions/3540
Sessions/3542
Sessions/3544
Sessions/160
Sessions/162
Sessions/164
Sessions/166
Sessions/168
Sessions/1692
Sessions/1694
Sessions/1696
Sessions/1698
Sessions/16
Sessions/1700
Sessions/2892
Sessions/2894
Sessions/2896
Sessions/2898
Sessions/28
Sessions/2900
Sessions/290
Sessions/292
Sessions/294
Sessions/2992
Sessions/2994
Sessions/156
Sessions/1570
Sessions/1572
Sessions/1574
Sessions/1576
Sessions/1578
Sessions/1580
Sessions/8
Sessions/912
Sessions/914
Sessions/916
Sessions/918
Sessions/920
Sessions/922
Sessions/924
Sessions/926
Sessions/928
Sessions/930
Sessions/40
Sessions/1044
Sessions/1046
Sessions/1048
Sessions/1050
Sessions/1052
Sessions/1054
Sessions/1056
Sessions/1058
Sessions/1060
Sessions/1062
Sessions/1064
Sessions/3644
Sessions/3646
Sessions/3648
Sessions/3650
Sessions/3652
Sessions/3654
Sessions/3656
Sessions/3658
Sessions/3660
Sessions/2500
Sessions/3788
Sessions/3790
Sessions/3792
Sessions/3794
Sessions/3796
Sessions/3798
Sessions/3800
Sessions/3802
Sessions/3804
Sessions/3806
Sessions/3808
Sessions/2996
Sessions/2998
Sessions/1702
Sessions/1704
Sessions/1706
Sessions/1708
Sessions/170
Sessions/1710
Sessions/1712
Sessions/1714
Sessions/1716
Sessions/1718
Sessions/1720
Sessions/3020
Sessions/3022
Sessions/3024
Sessions/3026
Sessions/3028
Sessions/3030
Sessions/30
Sessions/3122
Sessions/3124
Sessions/3126
Sessions/2630
Sessions/2632
Sessions/2634
Sessions/2636
Sessions/2638
Sessions/2640
Sessions/264
Sessions/266
Sessions/268
Sessions/26
Sessions/270
Sessions/1334
Sessions/1336
Sessions/1338
Sessions/1340
Sessions/134
Sessions/136
Sessions/138
Sessions/140
Sessions/142
Sessions/144
Sessions/146
Sessions/3546
Sessions/3548
Sessions/3550
Sessions/3642
Sessions/3772
Sessions/3774
Sessions/3776
Sessions/3778
Sessions/3780
Sessions/3782
Sessions/3784
Sessions/3786
Sessions/2368
Sessions/2370
Sessions/2372
Sessions/2374
Sessions/2376
Sessions/2378
Sessions/2380
Sessions/2472
Sessions/2474
Sessions/2476
Sessions/2478
Sessions/1066
Sessions/1068
Sessions/10
Sessions/1172
Sessions/1174
Sessions/1176
Sessions/1178
Sessions/1180
Sessions/1182
Sessions/1184
Sessions/1186
Sessions/3150
Sessions/3152
Sessions/3154
Sessions/3156
Sessions/3158
Sessions/3160
Sessions/32
Sessions/3382
Sessions/3384
Sessions/3386
Sessions/3388
Sessions/932
Sessions/934
Sessions/936
Sessions/938
Sessions/940
Sessions/942
Sessions/944
Sessions/946
Sessions/948
Sessions/950
Sessions/2214
Sessions/2216
Sessions/2218
Sessions/2220
Sessions/2222
Sessions/2224
Sessions/2226
Sessions/2228
Sessions/2230
Sessions/2232
Sessions/2234
Sessions/690
Sessions/6
Sessions/782
Sessions/784
Sessions/786
Sessions/788
Sessions/790
Sessions/792
Sessions/794
Sessions/796
Sessions/798
Sessions/1582
Sessions/1584
Sessions/1586
Sessions/1588
Sessions/158
Sessions/1590
Sessions/1592
Sessions/1594
Sessions/1596
Sessions/1598
Sessions/1600
Sessions/3402
Sessions/3404
Sessions/3406
Sessions/3408
Sessions/3410
Sessions/3412
Sessions/3414
Sessions/3416
Sessions/3418
Sessions/3420
Sessions/1320
Sessions/1322
Sessions/1324
Sessions/1326
Sessions/1328
Sessions/132
Sessions/1330
Sessions/1332
Sessions/410
Sessions/412
Sessions/414
Sessions/416
Sessions/418
Sessions/420
Sessions/422
Sessions/424
Sessions/426
Sessions/428
Sessions/430
Sessions/2502
Sessions/2504
Sessions/2506
Sessions/2508
Sessions/2510
Sessions/2602
Sessions/2604
Sessions/2606
Sessions/2608
Sessions/2610
Sessions/2612
Sessions/1210
Sessions/12
Sessions/1302
Sessions/1304
Sessions/1306
Sessions/1308
Sessions/1310
Sessions/1312
Sessions/1314
Sessions/1316
Sessions/1318
Sessions/2102
Sessions/2104
Sessions/2106
Sessions/2108
Sessions/2110
Sessions/2112
Sessions/2114
Sessions/2116
Sessions/2118
Sessions/2120
Sessions/2212
Sessions/2872
Sessions/2874
Sessions/2876
Sessions/2878
Sessions/2880
Sessions/2882
Sessions/2884
Sessions/2886
Sessions/2888
Sessions/288
Sessions/2890
Sessions/2
Sessions/3000
Sessions/3002
Sessions/3004
Sessions/3006
Sessions/3008
Sessions/3010
Sessions/3012
Sessions/3014
Sessions/3016
Sessions/3018
Sessions/4
Sessions/522
Sessions/524
Sessions/526
Sessions/528
Sessions/530
Sessions/532
Sessions/534
Sessions/536
Sessions/1042
Sessions/2750
Sessions/2752
Sessions/2754
Sessions/2756
Sessions/2758
Sessions/2760
Sessions/2762
Sessions/2764
Sessions/2766
Sessions/2768
Sessions/276
Sessions/668
Sessions/670
Sessions/672
Sessions/674
Sessions/676
Sessions/678
Sessions/680
Sessions/682
Sessions/684
Sessions/686
Sessions/688
Sessions/800
Sessions/802
Sessions/804
Sessions/806
Sessions/808
Sessions/810
Sessions/812
Sessions/814
Sessions/816
Sessions/818
Sessions/820
......@@ -58,6 +58,10 @@ class HCITaggingTest(unittest.TestCase):
self.assertEqual(len(self.db.objects()), 3490)
def test01b_objects_cvpr14(self):
self.assertEqual(len(self.db.objects('cvpr14')), 527)
@db_available
def test02_can_read_bdf(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment