fix cuda
Browse files
app.py
CHANGED
|
@@ -63,7 +63,7 @@ def resize_fix_aspect_ratio(img, field, target_width=None, target_height=None):
|
|
| 63 |
def inference(img_rgb, model_type):
|
| 64 |
if model_type is None:
|
| 65 |
return None, ""
|
| 66 |
-
pf_model = PerspectiveFields(model_type).eval().
|
| 67 |
pred = pf_model.inference(img_bgr=img_rgb[...,::-1])
|
| 68 |
img_h = img_rgb.shape[0]
|
| 69 |
field = {
|
|
|
|
| 63 |
def inference(img_rgb, model_type):
|
| 64 |
if model_type is None:
|
| 65 |
return None, ""
|
| 66 |
+
pf_model = PerspectiveFields(model_type).eval().to(device)
|
| 67 |
pred = pf_model.inference(img_bgr=img_rgb[...,::-1])
|
| 68 |
img_h = img_rgb.shape[0]
|
| 69 |
field = {
|
setup.py
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
from setuptools import setup, find_packages
|
| 2 |
-
|
| 3 |
-
setup(
|
| 4 |
-
name='debug',
|
| 5 |
-
version='0.1.0',
|
| 6 |
-
packages=find_packages(),
|
| 7 |
-
install_requires=[
|
| 8 |
-
'torch==1.11.0+cu113',
|
| 9 |
-
'torchvision==0.12.0+cu113',
|
| 10 |
-
'mmcv==2.0.0rc4',
|
| 11 |
-
'albumentations==1.3.0',
|
| 12 |
-
'fvcore==0.1.5.post20221221',
|
| 13 |
-
'gradio==3.29.0',
|
| 14 |
-
'h5py==3.8.0',
|
| 15 |
-
'imageio==2.27.0',
|
| 16 |
-
'matplotlib==3.7.1',
|
| 17 |
-
'numpy==1.24.2',
|
| 18 |
-
'opencv_contrib_python==4.7.0.72',
|
| 19 |
-
'opencv_python==4.7.0.72',
|
| 20 |
-
'opencv_python_headless==4.7.0.72',
|
| 21 |
-
'Pillow==9.5.0',
|
| 22 |
-
'pycocotools==2.0.6',
|
| 23 |
-
'pyequilib==0.3.0',
|
| 24 |
-
'scikit-learn==1.2.2',
|
| 25 |
-
'scipy==1.9.1',
|
| 26 |
-
'setuptools==59.5.0',
|
| 27 |
-
'timm==0.6.13',
|
| 28 |
-
'tqdm==4.65.0',
|
| 29 |
-
],
|
| 30 |
-
dependency_links=[
|
| 31 |
-
'git+https://github.com/facebookresearch/detectron2.git@4e447553eb32b6e3784df0b8fca286935107b2fd',
|
| 32 |
-
'git+https://github.com/jinlinyi/PerspectiveFields.git@dev#egg=perspective2d'
|
| 33 |
-
],
|
| 34 |
-
extras_require={
|
| 35 |
-
'cu113': [
|
| 36 |
-
'--extra-index-url https://download.pytorch.org/whl/cu113',
|
| 37 |
-
'--find-links https://download.openmmlab.com/mmcv/dist/cu113/torch1.11/index.html'
|
| 38 |
-
]
|
| 39 |
-
}
|
| 40 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|