Skip to content

Commit

Permalink
Merge pull request #6 from jina-ai/refactor-migration-jina3
Browse files Browse the repository at this point in the history
refactor: migration docarray
  • Loading branch information
numb3r3 authored Feb 21, 2022
2 parents c995888 + 7054c1f commit f39f3b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 3D Mesh Encoder

An Executor that receives Documents containing point sets data in its blob attribute, with shape `(N, 3)` and encodes it to embeddings of shape `(D,)`.
An Executor that receives Documents containing point sets data in its `tensor` attribute, with shape `(N, 3)` and encodes it to embeddings of shape `(D,)`.
Now, the following pretrained models are ready to be used to create embeddings:

- **PointConv-Shapenet-d512**: A **PointConv** model resulted in **512** dimension of embeddings, which is finetuned based on ShapeNet dataset.
Expand Down
4 changes: 2 additions & 2 deletions executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@


def normalize(doc: 'Document'):
points = doc.blob
points = doc.tensor
points = points - np.expand_dims(np.mean(points, axis=0), 0) # center
dist = np.max(np.sqrt(np.sum(points ** 2, axis=1)), 0)
points = points / dist # scale
doc.blob = points.astype(np.float32)
doc.tensor = points.astype(np.float32)
return doc


Expand Down

0 comments on commit f39f3b9

Please sign in to comment.