Spaces:
Configuration error
Configuration error
Commit ·
f1fdc79
1
Parent(s): 9b8ab84
Fix: compatibility issue with path
Browse files- app/inference.py +4 -1
app/inference.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import base64
|
|
|
|
| 3 |
import pathlib
|
| 4 |
import numpy as np
|
| 5 |
from pathlib import Path
|
|
@@ -8,7 +9,9 @@ import io
|
|
| 8 |
import cv2
|
| 9 |
|
| 10 |
os.environ["TRUST_REMOTE_CODE"] = "1"
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
|
| 13 |
from anomalib.deploy import TorchInferencer
|
| 14 |
|
|
|
|
| 1 |
import os
|
| 2 |
import base64
|
| 3 |
+
import platform
|
| 4 |
import pathlib
|
| 5 |
import numpy as np
|
| 6 |
from pathlib import Path
|
|
|
|
| 9 |
import cv2
|
| 10 |
|
| 11 |
os.environ["TRUST_REMOTE_CODE"] = "1"
|
| 12 |
+
# for offline test compatibility
|
| 13 |
+
if platform.system()=="Windows":
|
| 14 |
+
pathlib.PosixPath = pathlib.WindowsPath
|
| 15 |
|
| 16 |
from anomalib.deploy import TorchInferencer
|
| 17 |
|