MCPcopy Create free account
hub / github.com/Traffic-X/ViT-CoMer / __call__

Method __call__

detection/visualization.py:18–37  ·  view source on GitHub ↗

Call function to load images into results. Args: results (dict): A result dict contains the file name of the image to be read. Returns: dict: ``results`` will be returned containing loaded image.

(self, results)

Source from the content-addressed store, hash-verified

16 """A simple pipeline to load image."""
17
18 def __call__(self, results):
19 """Call function to load images into results.
20 Args:
21 results (dict): A result dict contains the file name
22 of the image to be read.
23 Returns:
24 dict: ``results`` will be returned containing loaded image.
25 """
26
27 if isinstance(results['img'], str):
28 results['filename'] = results['img']
29 results['ori_filename'] = results['img']
30 else:
31 results['filename'] = None
32 results['ori_filename'] = None
33 img = mmcv.imread(results['img'])
34 results['img'] = img
35 results['img_shape'] = img.shape
36 results['ori_shape'] = img.shape
37 return results
38
39
40def inference_detector(model, img):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected