Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combine from master #1

Merged
merged 33 commits into from
Jul 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
13a44f4
Update segpredict.py
berry-ding Jun 30, 2023
940b1b7
multi-bbox prompt
berry-ding Jun 30, 2023
c9fbfc4
multi-box prompt
berry-ding Jun 30, 2023
c7018b0
multi-box prompt
berry-ding Jun 30, 2023
02d0382
Fix the visualization problem of multi-boxes prompt
YinglongDu Jun 30, 2023
0db00de
fixed minor typos and clarified a bit
riyanswat Jul 1, 2023
1a4e3c5
Update README.md
riyanswat Jul 1, 2023
856bdbf
Return early instead of crashing
colinator Jul 2, 2023
063ffd0
Now FastSAMPrompt can operate directly on tensors
colinator Jul 2, 2023
1cb91e9
Merge pull request #67 from colinator/main
YinglongDu Jul 3, 2023
3da60df
Update model.py
zxDeepDiver Jul 3, 2023
9202a2e
Increase readability (#65)
an-yongqi Jul 6, 2023
40412c9
Fix the box prompt in RAEDME.md
Jul 6, 2023
5806af0
Update utils.py
berry-ding Jul 6, 2023
84b584a
Update prompt.py
nianjiuhuiyi Jul 7, 2023
953b0fd
FastSAMPrompt does now accept images of type str | np.ndarray | PIL.I…
uahic Jul 7, 2023
39d442c
Factorized image conversion function out to utils.py
uahic Jul 7, 2023
a090c77
Reversed code formatting's line breaks
uahic Jul 7, 2023
9389f16
Update prompt.py
YinglongDu Jul 10, 2023
32a3c53
Fix meshgrid function #82 from nianjiuhuiyi/main
YinglongDu Jul 10, 2023
9c0042f
format code and fix the with_contours and advanced options can not be…
gaoxinge Jul 11, 2023
673a1db
format code and fix the index retrieve in the text prompt
gaoxinge Jul 12, 2023
2970110
Update README.md
zxDeepDiver Jul 13, 2023
ba5550f
Update README.md
zxDeepDiver Jul 13, 2023
a1c0c30
add wider check option in text prompt mode for find more bigger result
gaoxinge Jul 13, 2023
f017dd8
fix typo
gaoxinge Jul 13, 2023
18ef855
Merge branch 'feat_np_array_prompt' of https://github.com/uahic/FastS…
YinglongDu Jul 14, 2023
c1a3717
Fix gradio_demo bug (#93)
an-yongqi Jul 14, 2023
dd7fceb
Better text prompt (#95)
an-yongqi Jul 14, 2023
e350fbe
fix with python3.9
YinglongDu Jul 14, 2023
12c93d1
Merge branch 'uahic-feat_np_array_prompt' into main
YinglongDu Jul 14, 2023
69cadb5
Update the news
Jul 14, 2023
9c9cb28
Merge branch 'main' of https://github.com/CASIA-IVA-Lab/FastSAM into …
YinglongDu Jul 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Return early instead of crashing
  • Loading branch information
colinator committed Jul 2, 2023
commit 856bdbf41a770f7f8dba09136f92da678b821546
7 changes: 5 additions & 2 deletions fastsam/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ def postprocess(self, preds, img, orig_imgs):
max_det=self.args.max_det,
nc=len(self.model.names),
classes=self.args.classes)


results = []
if len(p) == 0 or len(p[0]) == 0:
return results

full_box = torch.zeros_like(p[0][0])
full_box[2], full_box[3], full_box[4], full_box[6:] = img.shape[3], img.shape[2], 1.0, 1.0
full_box = full_box.view(1, -1)
Expand All @@ -30,7 +34,6 @@ def postprocess(self, preds, img, orig_imgs):
full_box[0][6:] = p[0][critical_iou_index][:,6:]
p[0][critical_iou_index] = full_box

results = []
proto = preds[1][-1] if len(preds[1]) == 3 else preds[1] # second output is len 3 if pt, but only 1 if exported
for i, pred in enumerate(p):
orig_img = orig_imgs[i] if isinstance(orig_imgs, list) else orig_imgs
Expand Down