MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / __init__

Method __init__

datasets/utils/tsv/tsv_io.py:13–33  ·  view source on GitHub ↗
(self, tsv_file, silence=True)

Source from the content-addressed store, hash-verified

11
12class TSVFile(object):
13 def __init__(self, tsv_file, silence=True):
14 self.tsv_file = tsv_file
15 self.lineidx = op.splitext(tsv_file)[0] + '.lineidx'
16
17 self.label_file = op.splitext(tsv_file)[0] + '.label'
18 self.label_lineidx = op.splitext(tsv_file)[0] + '.label.lineidx'
19
20 if os.path.exists(self.label_file):
21 self.split_label = True
22 else:
23 self.split_label = False
24
25 self._fp = None
26 self._lineidx = None
27
28 self._label_fp = None
29 self._label_lineidx = None
30
31 self.pid = None
32 self.silence = silence
33 self._ensure_lineidx_loaded()
34
35 def num_rows(self):
36 return len(self._lineidx)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected