mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-11-20 09:01:16 -08:00
update model and some infer code
This commit is contained in:
1 parent
3f92864d35
commit
dc8602b4eb
3 files changed
+4
-3
No files matched your search
Binary file not shown.
@@ -13,7 +13,6 @@ def run_model(self, embedding, netural_blends):
|
||||
frame = transforms.to_tensor(frame)
|
||||
frame = transforms.unsqueeze(frame, 0)
|
||||
frame = transforms.normalize(frame)
|
||||
print(frame)
|
||||
frame = frame * 2 - 1
|
||||
#make the image 3 channels but concat
|
||||
frame = np.concatenate((frame, frame, frame), axis=1)
|
||||
@@ -55,9 +54,10 @@ def run_model_embeding(self):
|
||||
frame = transforms.unsqueeze(frame, 0)
|
||||
frame = transforms.normalize(frame)
|
||||
frame = frame * 2 - 1
|
||||
frame = np.concatenate((frame, frame, frame), axis=1)
|
||||
|
||||
|
||||
#convert to color by duplicating the channels
|
||||
frame = np.concatenate((frame, frame, frame), axis=1)
|
||||
|
||||
out = self.sess_encoder.run([self.output_name_encoder], {self.input_name_encoder: frame})
|
||||
out = out[0]
|
||||
output_emb = np.concatenate((out, out), axis=-1)
|
||||
|
||||
@@ -217,6 +217,7 @@ class BabbleProcessor:
|
||||
|
||||
def run(self):
|
||||
run_model_embeding(self)
|
||||
print("[INFO] Created model embeding")
|
||||
#load the model embeding. It's a NPY
|
||||
embed_netural = np.load('UserData/model_embeding.npy')
|
||||
netural_blends = np.load('UserData/netural.npy')
|
||||
|
||||
Reference in new issue
Block a user