weights_test.py 621 B

123456789101112131415
  1. from anonymizer.detection import download_weights
  2. class TestDownloadWeights:
  3. @staticmethod
  4. def test_it_downloads_weights(tmp_path):
  5. weights_directory = tmp_path / 'weights'
  6. assert len(list(weights_directory.glob('**/*.pb'))) == 0
  7. download_weights(download_directory=weights_directory, version='1.0.0')
  8. assert len(list(weights_directory.glob('**/*.pb'))) == 2
  9. assert (weights_directory / 'weights_face_v1.0.0.pb').is_file()
  10. assert (weights_directory / 'weights_plate_v1.0.0.pb').is_file()
  11. assert not (weights_directory / 'nonexistent_path.pb').is_file()