khanrc
commited on
Commit
Β·
0b11938
1
Parent(s):
1cbae8f
Update README
Browse files
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
title: TCL
|
3 |
emoji: π
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.23.0
|
8 |
app_file: app.py
|
|
|
1 |
---
|
2 |
title: TCL
|
3 |
emoji: π
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.23.0
|
8 |
app_file: app.py
|
app.py
CHANGED
@@ -23,7 +23,6 @@ import json
|
|
23 |
from contextlib import ExitStack
|
24 |
import gradio as gr
|
25 |
import torch
|
26 |
-
from torch.cuda.amp import autocast
|
27 |
|
28 |
from detectron2.evaluation import inference_context
|
29 |
|
@@ -117,8 +116,10 @@ def inference(img, query):
|
|
117 |
stack.enter_context(inference_context(model))
|
118 |
stack.enter_context(torch.no_grad())
|
119 |
|
120 |
-
|
121 |
-
|
|
|
|
|
122 |
|
123 |
return visualized_output
|
124 |
|
|
|
23 |
from contextlib import ExitStack
|
24 |
import gradio as gr
|
25 |
import torch
|
|
|
26 |
|
27 |
from detectron2.evaluation import inference_context
|
28 |
|
|
|
116 |
stack.enter_context(inference_context(model))
|
117 |
stack.enter_context(torch.no_grad())
|
118 |
|
119 |
+
if device.type == "cuda":
|
120 |
+
stack.enter_context(torch.autocast("cuda"))
|
121 |
+
|
122 |
+
visualized_output = model.forward_vis(img, query)
|
123 |
|
124 |
return visualized_output
|
125 |
|