|
| 1 | +# Copyright (c) MONAI Consortium |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +# Unless required by applicable law or agreed to in writing, software |
| 7 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 8 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 9 | +# See the License for the specific language governing permissions and |
| 10 | +# limitations under the License. |
| 11 | +import unittest |
| 12 | + |
| 13 | +import requests |
| 14 | +import torch |
| 15 | + |
| 16 | +from tests.integration import SERVER_URI |
| 17 | + |
| 18 | + |
| 19 | +class EndPointInfer(unittest.TestCase): |
| 20 | + def test_tooltracking(self): |
| 21 | + if not torch.cuda.is_available(): |
| 22 | + return |
| 23 | + |
| 24 | + model = "tooltracking" |
| 25 | + image = "Video_2_VTS_01_1_Trim_04-40_f600" |
| 26 | + |
| 27 | + response = requests.post(f"{SERVER_URI}/infer/{model}?image={image}") |
| 28 | + assert response.status_code == 200 |
| 29 | + |
| 30 | + def test_inbody(self): |
| 31 | + if not torch.cuda.is_available(): |
| 32 | + return |
| 33 | + |
| 34 | + model = "inbody" |
| 35 | + image = "Video_2_VTS_01_1_Trim_04-40_f600" |
| 36 | + |
| 37 | + response = requests.post(f"{SERVER_URI}/infer/{model}?image={image}&output=json") |
| 38 | + assert response.status_code == 200 |
| 39 | + |
| 40 | + def test_deepedit(self): |
| 41 | + if not torch.cuda.is_available(): |
| 42 | + return |
| 43 | + |
| 44 | + model = "deepedit" |
| 45 | + image = "Video_2_VTS_01_1_Trim_04-40_f600" |
| 46 | + |
| 47 | + response = requests.post(f"{SERVER_URI}/infer/{model}?image={image}") |
| 48 | + assert response.status_code == 200 |
| 49 | + |
| 50 | + |
| 51 | +if __name__ == "__main__": |
| 52 | + unittest.main() |
0 commit comments