(state_dict)
| 11 | from .craft import CRAFT |
| 12 | |
| 13 | def copyStateDict(state_dict): |
| 14 | if list(state_dict.keys())[0].startswith("module"): |
| 15 | start_idx = 1 |
| 16 | else: |
| 17 | start_idx = 0 |
| 18 | new_state_dict = OrderedDict() |
| 19 | for k, v in state_dict.items(): |
| 20 | name = ".".join(k.split(".")[start_idx:]) |
| 21 | new_state_dict[name] = v |
| 22 | return new_state_dict |
| 23 | |
| 24 | def test_net(canvas_size, mag_ratio, net, image, text_threshold, link_threshold, low_text, poly, device, estimate_num_chars=False): |
| 25 | if isinstance(image, np.ndarray) and len(image.shape) == 4: # image is batch of np arrays |
no outgoing calls
no test coverage detected
searching dependent graphs…