Spaces:
Sleeping
Sleeping
efengx
commited on
Commit
·
bd5fe6f
1
Parent(s):
7537bce
fix: update
Browse files- fengx_launch.ipynb +2 -17
- fengxai/SelfSupervised.py +4 -3
fengx_launch.ipynb
CHANGED
@@ -33,24 +33,9 @@
|
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
-
"execution_count":
|
37 |
"metadata": {},
|
38 |
-
"outputs": [
|
39 |
-
{
|
40 |
-
"name": "stdout",
|
41 |
-
"output_type": "stream",
|
42 |
-
"text": [
|
43 |
-
"Enumerating objects: 7, done.\n",
|
44 |
-
"Counting objects: 100% (7/7), done.\n",
|
45 |
-
"Delta compression using up to 8 threads\n",
|
46 |
-
"Compressing objects: 100% (4/4), done.\n",
|
47 |
-
"Writing objects: 100% (4/4), 666 bytes | 666.00 KiB/s, done.\n",
|
48 |
-
"Total 4 (delta 3), reused 0 (delta 0), pack-reused 0\n",
|
49 |
-
"To https://huggingface.co/spaces/rjx/rjxai_image_identification\n",
|
50 |
-
" a3ecec7..def047e main -> main\n"
|
51 |
-
]
|
52 |
-
}
|
53 |
-
],
|
54 |
"source": [
|
55 |
"# 任务:提交代码到git仓库\n",
|
56 |
"!git push origin main"
|
|
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
+
"execution_count": 11,
|
37 |
"metadata": {},
|
38 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
"source": [
|
40 |
"# 任务:提交代码到git仓库\n",
|
41 |
"!git push origin main"
|
fengxai/SelfSupervised.py
CHANGED
@@ -47,10 +47,10 @@ class SelfSupervised:
|
|
47 |
|
48 |
|
49 |
# 预测图片
|
50 |
-
def imagePredict(self,
|
51 |
from groundingdino.util.inference import load_image, predict
|
52 |
-
|
53 |
-
src, img = load_image(
|
54 |
h, w, _ = src.shape
|
55 |
boxes, logits, phrases = predict(
|
56 |
model=self.groundingdino_model,
|
@@ -60,6 +60,7 @@ class SelfSupervised:
|
|
60 |
text_threshold=textTreshold
|
61 |
)
|
62 |
# 查看annotate相关的信息
|
|
|
63 |
imgAnnnotated, xyxy = self.checkAnnotate(
|
64 |
image_source=src, boxes=boxes, logits=logits, phrases=phrases
|
65 |
)
|
|
|
47 |
|
48 |
|
49 |
# 预测图片
|
50 |
+
def imagePredict(self, imageFile, item="clothing", boxThreshold=0.3, textTreshold=0.25):
|
51 |
from groundingdino.util.inference import load_image, predict
|
52 |
+
print("imgFile=", imageFile)
|
53 |
+
src, img = load_image(imageFile)
|
54 |
h, w, _ = src.shape
|
55 |
boxes, logits, phrases = predict(
|
56 |
model=self.groundingdino_model,
|
|
|
60 |
text_threshold=textTreshold
|
61 |
)
|
62 |
# 查看annotate相关的信息
|
63 |
+
print("src=", src)
|
64 |
imgAnnnotated, xyxy = self.checkAnnotate(
|
65 |
image_source=src, boxes=boxes, logits=logits, phrases=phrases
|
66 |
)
|