MCPcopy
hub / github.com/Audio-AGI/AudioSep / process_ipc

Function process_ipc

models/CLAP/open_clip/utils.py:220–231  ·  view source on GitHub ↗
(index_path, classes_num, filename)

Source from the content-addressed store, hash-verified

218
219
220def process_ipc(index_path, classes_num, filename):
221 # load data
222 logging.info("Load Data...............")
223 ipc = [[] for _ in range(classes_num)]
224 with h5py.File(index_path, "r") as f:
225 for i in tqdm(range(len(f["target"]))):
226 t_class = np.where(f["target"][i])[0]
227 for t in t_class:
228 ipc[t].append(i)
229 print(ipc)
230 np.save(filename, ipc)
231 logging.info("Load Data Succeed...............")
232
233
234def save_to_dict(s, o_={}):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected