Skip to content

Commit

Permalink
fixed example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed Apr 10, 2024
1 parent 3f02965 commit 08ff558
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions examples/va_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"import vision_agent as va\n",
"import pandas as pd\n",
"import textwrap\n",
"import json\n",
"import os\n",
"from IPython.display import Image\n",
"from PIL import Image"
]
Expand Down Expand Up @@ -393,7 +394,7 @@
}
],
"source": [
"ans = t(prompt=\"shoes\", image=\"/home/shankar/workspace/img/shoes.jpg\", box_threshold=0.30, iou_threshold=0.2)\n",
"ans = t(prompt=\"shoes\", image=\"shoes.jpg\", box_threshold=0.30, iou_threshold=0.2)\n",
"len(ans[\"labels\"])"
]
},
Expand Down Expand Up @@ -465,7 +466,7 @@
"metadata": {},
"outputs": [],
"source": [
"ans = t1(prompt=\"bird\", image=\"/home/shankar/workspace/img/birds.jpg\", box_threshold=0.40, iou_threshold=0.2)"
"ans = t1(prompt=\"bird\", image=\"birds.jpg\", box_threshold=0.40, iou_threshold=0.2)"
]
},
{
Expand Down Expand Up @@ -543,59 +544,52 @@
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"t2 = va.tools.CLIP()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'labels': ['crow', ' cheetah'], 'scores': [0.9999, 0.0001]}"
"{'labels': [], 'bboxes': [], 'masks': [], 'scores': []}"
]
},
"execution_count": 26,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t2(prompt=\"crow, cheetah\", image=\"/home/shankar/workspace/img/birds.jpg\",)"
"t1(prompt=\"bird\", image=\"shoes.jpg\",)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"t2 = va.tools.CLIP()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'labels': [], 'bboxes': [], 'masks': [], 'scores': []}"
"{'labels': ['crow', ' cheetah'], 'scores': [0.9999, 0.0001]}"
]
},
"execution_count": 27,
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t1(prompt=\"bird\", image=\"/home/shankar/workspace/img/shoes.jpg\",)"
"t2(prompt=\"crow, cheetah\", image=\"birds.jpg\",)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 08ff558

Please sign in to comment.