Loading test/generic/test_classify.py +3 −0 Original line number Diff line number Diff line from unittest import skipUnless from unittest.mock import patch import numpy as np import pytest from PIL import Image from hbutils.testing import vpip from huggingface_hub.utils import reset_sessions from imgutils.generic import classify_predict_score Loading Loading @@ -232,6 +234,7 @@ class TestGenericClassify: assert np.linalg.norm(results['embedding']) == pytest.approx(np.linalg.norm(expected_embedding)) @patch("huggingface_hub.constants.HF_HUB_OFFLINE", True) @skipUnless(vpip('huggingface_hub') < '0.34', 'Has problem on huggingface 0.34+') def test_classify_predict_score_top5_offline_mode(self, clean_session): image = Image.open(get_testfile('png_640.png')) scores = classify_predict_score( Loading test/generic/test_yolo.py +3 −0 Original line number Diff line number Diff line from unittest import skipUnless from unittest.mock import patch import pytest from hbutils.testing import vpip from huggingface_hub import configure_http_backend from huggingface_hub.utils import reset_sessions Loading Loading @@ -52,6 +54,7 @@ class TestGenericYOLO: ) == [] @patch("huggingface_hub.constants.HF_HUB_OFFLINE", True) @skipUnless(vpip('huggingface_hub') < '0.34', 'Has problem on huggingface 0.34+') def test_detect_faces_with_offline_mode(self, clean_session): configure_http_backend() detection = yolo_predict( Loading Loading
test/generic/test_classify.py +3 −0 Original line number Diff line number Diff line from unittest import skipUnless from unittest.mock import patch import numpy as np import pytest from PIL import Image from hbutils.testing import vpip from huggingface_hub.utils import reset_sessions from imgutils.generic import classify_predict_score Loading Loading @@ -232,6 +234,7 @@ class TestGenericClassify: assert np.linalg.norm(results['embedding']) == pytest.approx(np.linalg.norm(expected_embedding)) @patch("huggingface_hub.constants.HF_HUB_OFFLINE", True) @skipUnless(vpip('huggingface_hub') < '0.34', 'Has problem on huggingface 0.34+') def test_classify_predict_score_top5_offline_mode(self, clean_session): image = Image.open(get_testfile('png_640.png')) scores = classify_predict_score( Loading
test/generic/test_yolo.py +3 −0 Original line number Diff line number Diff line from unittest import skipUnless from unittest.mock import patch import pytest from hbutils.testing import vpip from huggingface_hub import configure_http_backend from huggingface_hub.utils import reset_sessions Loading Loading @@ -52,6 +54,7 @@ class TestGenericYOLO: ) == [] @patch("huggingface_hub.constants.HF_HUB_OFFLINE", True) @skipUnless(vpip('huggingface_hub') < '0.34', 'Has problem on huggingface 0.34+') def test_detect_faces_with_offline_mode(self, clean_session): configure_http_backend() detection = yolo_predict( Loading