Skip to content

Commit

Permalink
Code Refactor ruff check --fix --extend-select I (#47)
Browse files Browse the repository at this point in the history
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
  • Loading branch information
glenn-jocher and UltralyticsAssistant committed Jun 16, 2024
1 parent a066a82 commit 4f6a049
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: Ultralytics Actions

on:
push:
branches: [main,master]
branches: [main]
pull_request:
branches: [main,master]
branches: [main]

jobs:
format:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The repository contains various methods for vehicle speed estimation. If you're

<!-- Sample results image -->

<img src="https://github.com/ultralytics/velocity/blob/main/results.jpg">
<img src="https://github.com/ultralytics/velocity/blob/main/results.jpg">

# 📚 Citation

Expand Down
6 changes: 3 additions & 3 deletions utils/NLS.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def fcnNLS_batch(K, P, pw, cw): # solves for pxyz, cxyz[1:], crpy[1:]
z[nanz] = 0
crpy = np.zeros((nc, 3))
x = np.concatenate((pw, cw[1:], crpy)).ravel() # [tp_pos, cam_pos, cam_rpy, K3]
range_cal = norm(cw[1])
norm(cw[1])

def fzKautograd_batch(x, K, nc, nt): # for autograd
pw = x[: nt * 3].reshape(nt, 3)
Expand Down Expand Up @@ -247,7 +247,7 @@ def fzKautograd_batch(x, K, nc, nt): # for autograd
pw = x[:j].reshape(nt, 3)
cw = x[j : j + nc * 3].reshape(nc, 3) # cam pos
cw = np.concatenate((np.zeros((1, 3)), cw), 0)
ca = x[j + nc * 3 : j + nc * 3 * 2].reshape(nc, 3) # cam rpy
x[j + nc * 3 : j + nc * 3 * 2].reshape(nc, 3) # cam rpy
return cw, pw


Expand Down Expand Up @@ -325,5 +325,5 @@ def fzKautograd_batch(x, K, nc, nt): # for autograd
pw = x[:j].reshape(nt, 3)
cw = sc2cc(sc) @ C # cam pos
cw = np.concatenate((np.zeros((1, 3)), cw), 0)
ca = x[j : j + 3] # cam rpy
x[j : j + 3] # cam rpy
return cw, pw
3 changes: 1 addition & 2 deletions vidExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def vidExamplefcn():
P[0:2, vg, i] = p.T # xy
P[2:4, vp, i] = p_.T # xy_proj
P[4, vg, i] = i
im0 = im

msvFrame = 5
if i == msvFrame:
Expand All @@ -168,7 +167,7 @@ def vidExamplefcn():
# imrgb = cv2.cvtColor(imbgr,cv2.COLOR_BGR2RGB)
# plots.imshow(cv2.cvtColor(imrgb,cv2.COLOR_BGR2HSV_FULL)[:,:,0])
im_gaussian = cv2.GaussianBlur(im, (3, 3), 0)
im_canny = cv2.Canny(im_gaussian, 100, 200)
cv2.Canny(im_gaussian, 100, 200)
# plots.imshow(cv2.GaussianBlur(im_canny, (9, 9), 0))

if isVideo:
Expand Down

0 comments on commit 4f6a049

Please sign in to comment.