Spaces:
Running
on
Zero
Running
on
Zero
fix np.float
Browse files
src/face3d/models/arcface_torch/torch2onnx.py
CHANGED
@@ -6,7 +6,7 @@ import torch
|
|
6 |
def convert_onnx(net, path_module, output, opset=11, simplify=False):
|
7 |
assert isinstance(net, torch.nn.Module)
|
8 |
img = np.random.randint(0, 255, size=(112, 112, 3), dtype=np.int32)
|
9 |
-
img = img.astype(np.
|
10 |
img = (img / 255. - 0.5) / 0.5 # torch style norm
|
11 |
img = img.transpose((2, 0, 1))
|
12 |
img = torch.from_numpy(img).unsqueeze(0).float()
|
|
|
6 |
def convert_onnx(net, path_module, output, opset=11, simplify=False):
|
7 |
assert isinstance(net, torch.nn.Module)
|
8 |
img = np.random.randint(0, 255, size=(112, 112, 3), dtype=np.int32)
|
9 |
+
img = img.astype(np.float64)
|
10 |
img = (img / 255. - 0.5) / 0.5 # torch style norm
|
11 |
img = img.transpose((2, 0, 1))
|
12 |
img = torch.from_numpy(img).unsqueeze(0).float()
|