Spaces:
Build error
Build error
Commit
·
5d3ed81
1
Parent(s):
914b677
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,19 +83,6 @@ classifier = BUILDIN_CLASSIFIER[vocabulary]
|
|
| 83 |
num_classes = len(metadata.thing_classes)
|
| 84 |
reset_cls_test(predictor.model, classifier, num_classes)
|
| 85 |
|
| 86 |
-
session_token = os.environ.get("SessionToken")
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
def get_response_from_chatbot(text):
|
| 90 |
-
try:
|
| 91 |
-
api = ChatGPT(session_token)
|
| 92 |
-
resp = api.send_message(text)
|
| 93 |
-
api.refresh_auth()
|
| 94 |
-
api.reset_conversation()
|
| 95 |
-
response = resp["message"]
|
| 96 |
-
except:
|
| 97 |
-
response = "Sorry, I'm busy. Try again later."
|
| 98 |
-
return response
|
| 99 |
|
| 100 |
|
| 101 |
def inference(img):
|
|
@@ -131,7 +118,7 @@ def inference(img):
|
|
| 131 |
)
|
| 132 |
|
| 133 |
|
| 134 |
-
output_str = "Imagine you are an intelligent image captioner.
|
| 135 |
for line in object_list_str:
|
| 136 |
output_str += line + "\n"
|
| 137 |
|
|
|
|
| 83 |
num_classes = len(metadata.thing_classes)
|
| 84 |
reset_cls_test(predictor.model, classifier, num_classes)
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
def inference(img):
|
|
|
|
| 118 |
)
|
| 119 |
|
| 120 |
|
| 121 |
+
output_str = "Imagine you are an intelligent image captioner. Describe each object in detail separately, in a scene where the X,Y coordinates and width,height of each object is given below. In the end give an overall summary of the scene\n"
|
| 122 |
for line in object_list_str:
|
| 123 |
output_str += line + "\n"
|
| 124 |
|