class CocoExporterTests(unittest.TestCase): def setUp(self): rmtree(TMP_DIRS[0], ignore_errors=True) self.ds = PascalFaces(DS_DIR) def test_coco(self): self.ds.export(TMP_DIRS[0], target_format='coco')
class TfExporterTests(unittest.TestCase): def setUp(self): rmtree(TMP_DIRS[1], ignore_errors=True) self.ds = PascalFaces(DS_DIR) def test_tf(self): self.ds.export(TMP_DIRS[1], target_format='tensorflow')
def create_dataset(dataset_name, data_dir): if not dataset_name: dataset_name = 'mafa' if dataset_name == 'widerface': from morghulis.widerface import Wider ds = Wider(data_dir) elif dataset_name == 'fddb': from morghulis.fddb import FDDB ds = FDDB(data_dir) elif dataset_name == 'afw': from morghulis.afw import AFW ds = AFW(data_dir) elif dataset_name == 'pascal_faces': from morghulis.pascal_faces import PascalFaces ds = PascalFaces(data_dir) elif dataset_name == 'mafa': from morghulis.mafa import Mafa ds = Mafa(data_dir) elif dataset_name == 'caltech': from morghulis.caltech_faces import CaltechFaces ds = CaltechFaces(data_dir) elif dataset_name == 'ufdd': from morghulis.ufdd import UFDD ds = UFDD(data_dir) else: logging.error('Invalid dataset name %s', dataset_name) raise ValueError('Invalid dataset name %s' % dataset_name) return ds
def main(): parser = argparse.ArgumentParser() parser.add_argument('--dataset', dest='dataset', action='store', required=True, help='widerface, fddb or afw') parser.add_argument('--output_dir', dest='output_dir', action='store', required=True, help='') args = parser.parse_args() dataset = args.dataset output_dir = args.output_dir if dataset == 'widerface': from morghulis.widerface import Wider ds = Wider(output_dir) elif dataset == 'fddb': from morghulis.fddb import FDDB ds = FDDB(output_dir) elif dataset == 'afw': from morghulis.afw import AFW ds = AFW(output_dir) elif dataset == 'pascal_faces': from morghulis.pascal_faces import PascalFaces ds = PascalFaces(output_dir) else: logging.error('Invalid dataset name %s', dataset) raise ValueError('Invalid dataset name %s' % dataset) ds.download()
def setUp(self): rmtree(TMP_DIRS[1], ignore_errors=True) self.ds = PascalFaces(DS_DIR)