-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
- Loading branch information
1 parent
72d863f
commit 5997b6d
Showing
1 changed file
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import unittest | ||
from model_optimization import load_optimized_model # Replace with the actual module name | ||
|
||
from model_optimization import \ | ||
load_optimized_model # Replace with the actual module name | ||
|
||
|
||
class TestModelLoading(unittest.TestCase): | ||
def test_model_loading(self): | ||
"""Test if the optimized model loads correctly.""" | ||
model = load_optimized_model() | ||
self.assertIsNotNone(model, "The model should not be None after loading.") | ||
self.assertTrue(hasattr(model, 'predict'), "The loaded model should have a 'predict' method.") | ||
self.assertIsNotNone( | ||
model, "The model should not be None after loading.") | ||
self.assertTrue( | ||
hasattr(model, "predict"), | ||
"The loaded model should have a 'predict' method.", | ||
) | ||
|
||
def test_model_input_shape(self): | ||
"""Test if the model input shape is as expected.""" | ||
model = load_optimized_model() | ||
input_shape = model.input_shape | ||
self.assertEqual(input_shape, (None, 224, 224, 3), "Model input shape should be (None, 224, 224, 3).") | ||
self.assertEqual( | ||
input_shape, | ||
(None, 224, 224, 3), | ||
"Model input shape should be (None, 224, 224, 3).", | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |