Skip to content

Commit

Permalink
update tests for get_cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
rwood-97 committed Oct 22, 2024
1 parent 8653909 commit a3f7186
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions test_text_spotting/test_deepsolo_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import geopandas as gpd
import pandas as pd
import pytest
from deepsolo.config import get_cfg
from detectron2.engine import DefaultPredictor
from detectron2.structures.instances import Instances

Expand Down Expand Up @@ -70,6 +71,11 @@ def runner_run_all(init_runner, mock_response):
return runner


def test_get_cfg():
cfg = get_cfg()
assert "TEMPERATURE" in cfg["MODEL"]["TRANSFORMER"].keys()


def test_deepsolo_init(init_dataframes):
parent_df, patch_df = init_dataframes
runner = DeepSoloRunner(
Expand Down
7 changes: 7 additions & 0 deletions test_text_spotting/test_dptext_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest
from detectron2.engine import DefaultPredictor
from detectron2.structures.instances import Instances
from dptext_detr.config import get_cfg

from mapreader import DPTextDETRRunner
from mapreader.load import MapImages
Expand Down Expand Up @@ -70,6 +71,12 @@ def runner_run_all(init_runner, mock_response):
return runner


def test_get_cfg():
cfg = get_cfg()
assert "USE_POLYGON" in cfg["MODEL"]["TRANSFORMER"].keys()
assert "DET_ONLY" in cfg["TEST"].keys()


def test_dptext_init(init_dataframes):
parent_df, patch_df = init_dataframes
runner = DPTextDETRRunner(
Expand Down
4 changes: 2 additions & 2 deletions test_text_spotting/test_maptext_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def runner_run_all(init_runner, mock_response):

def test_get_cfg():
cfg = get_cfg()
print(cfg, flush=True)
assert cfg["MODEL"]["TRANSFORMER"].get("TEMPERATURE")
assert "TEMPERATURE" in cfg["MODEL"]["TRANSFORMER"].keys()
assert "FROZEN" in cfg["MODEL"]["TRANSFORMER"].keys()


def test_maptext_init(init_dataframes):
Expand Down

0 comments on commit a3f7186

Please sign in to comment.