Open sai-chowdary opened 1 year ago
I grappled with this for a few hours. I started with your suggestion sc = [x for x in sc if x > 0.1]
but realized it handled some cases differently, specifically when the actual coordinate is 0 (i.e. along the top or left borders). Instead I handled the entries one pair at a time. I added these lines after L90:
tol = 1e-3
cleaned = []
for x, y in zip(sc[::2], sc[1::2]):
if x > tol and y > tol:
cleaned.append(x)
cleaned.append(y)
annotation["segmenation"].append(cleaned)
It's not particularly compact but it seems to do the job.
The pair of coordinates at the origin appears to be an artifact of the call to simplify_coords_vwp
and I'm not sure if it is consistently the first pair of elements, so best to go through the full list.
当我查看图像时,从图像的左上角生成了一条粉红色的线。我试图通过从文件dataset_explorer.py打印变量“sc”来调查这个问题,我发现开始时生成的随机值“6.91669498947497e-310,6.91669498947497e-310”。为了克服这个问题,我在文件dataset_explorer.py中添加了这一行“sc = [x for x in sc if x > 0.1]”。
截图:
请参阅随附的屏幕截图以更好地理解。
预期成果:
粉色线不应从图像的左上角生成。
重现步骤:
- 运行segment_anything_annotator.py。
- 标记任何对象。
- 选择标签名称并单击保存按钮,然后单击添加按钮。
- 将在图像上找到错误。
it is also have some problem
When I view the image, there is a pink line generated from the top left corner of the image. I tried to investigate the issue by printing variable "sc" from the file dataset_explorer.py, and I found a random value "6.91669498947497e-310, 6.91669498947497e-310" generated at the beginning. To overcome this issue, I added this line "sc = [x for x in sc if x > 0.1]" in the file dataset_explorer.py.
Screenshot:
Please refer to the attached screenshots for better understanding.
Expected Outcome:
The pink line should not be generated from the top left corner of the image.
Steps to Reproduce: