def test_create_network_normal_different_version(self): client = Client(api_token="57c60ade109be36ef1a1c89f56247109fa448741") client.checkout_project( project_token="4b003477-3b31-4f74-8952-8a9dc879b0ec") client.create_network(network_name="test_creation_network_0") self.assertTrue(isinstance(client.training_id, int)) self.assertEqual(client.training_id, 0) self.assertTrue(isinstance(client.network_names, list)) self.assertTrue(isinstance(client.network_name, str)) self.assertTrue(isinstance(client.dict_annotations, dict)) self.assertEqual( client.base_dir, os.path.join(client.project_name, client.network_name, str(client.training_id))) self.assertEqual(client.metrics_dir, os.path.join(client.base_dir, 'metrics')) self.assertEqual(client.checkpoint_dir, os.path.join(client.base_dir, 'checkpoint')) self.assertEqual(client.record_dir, os.path.join(client.base_dir, 'records')) self.assertEqual(client.config_dir, os.path.join(client.base_dir, 'config')) self.assertEqual(client.results_dir, os.path.join(client.base_dir, 'results')) self.assertEqual(client.exported_model_dir, os.path.join(client.base_dir, 'exported_model')) self.assertTrue(os.path.isdir(client.base_dir)) self.assertTrue(os.path.isdir(client.metrics_dir)) self.assertTrue(os.path.isdir(client.checkpoint_dir)) self.assertTrue(os.path.isdir(client.record_dir)) self.assertTrue(os.path.isdir(client.config_dir)) self.assertTrue(os.path.isdir(client.results_dir)) self.assertTrue(os.path.isdir(client.exported_model_dir))
def test_train_test_split(self): client = Client(api_token="57c60ade109be36ef1a1c89f56247109fa448741") client.checkout_project( project_token="4b003477-3b31-4f74-8952-8a9dc879b0ec") client.create_network(network_name="test_creation_network_0") client.dl_annotations() client.train_test_split(prop=0.7) self.assertEqual(len(client.index_url), len(client.dict_annotations["images"])) self.assertEqual(len(client.train_list), len(client.train_list_id)) self.assertEqual(len(client.eval_list), len(client.eval_list_id))