瀏覽代碼

fix(utils): missing edge when resample segments (#8092)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
modifyDataloader
HRan2004 GitHub 2 年之前
父節點
當前提交
cf298fb72f
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. +1
    -0
      utils/general.py

+ 1
- 0
utils/general.py 查看文件

@@ -738,6 +738,7 @@ def segments2boxes(segments):
def resample_segments(segments, n=1000):
# Up-sample an (n,2) segment
for i, s in enumerate(segments):
s = np.concatenate((s, s[0:1, :]), axis=0)
x = np.linspace(0, len(s) - 1, n)
xp = np.arange(len(s))
segments[i] = np.concatenate([np.interp(x, xp, s[:, i]) for i in range(2)]).reshape(2, -1).T # segment xy

Loading…
取消
儲存