Skip to content

Instantly share code, notes, and snippets.

@cobanov
Created April 4, 2022 21:46
Show Gist options
  • Save cobanov/93d4a987df564c232eb1511b8e82e128 to your computer and use it in GitHub Desktop.
Save cobanov/93d4a987df564c232eb1511b8e82e128 to your computer and use it in GitHub Desktop.
import numpy as np
import os
path = ''
files = os.listdir(path)
data = np.zeros((1, 128))
identifiers = np.full((data.shape[0]), 0)
for file in files:
temp = np.load(path+file)
data = np.concatenate((data, temp), axis=0)
identifiers = np.append(identifiers, np.full((temp.shape[0]), int(file.split('.')[0][-3:]) ))
print('Done', file, data.shape[0])
np.savez('merged_embeddings.npz', filelist=identifiers, features=data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment