Commit Graph

294 Commits

Author SHA1 Message Date
Willem Melching
47aec23fb3 modeld: sync based on frame timestamp (#23901)
* sync based on frame ts

* log extra frame id

* ints only

* update ref

* no rounding errors
old-commit-hash: 492398826f
2022-03-07 10:46:15 +01:00
George Hotz
6b52bc6c13 model: mse err from 0.02-> 0.000056 (#23891)
* mse err from 0.028070712 -> 5.8073703e-05

* build with weights fixup

* need thneed lib also

* don't break for binaries

* static analysis says i need init

* check the bias

* load_dlc_weights

* nicer scons

* tested scons

* fix static

* pylint issue

* new ref

* a few more asserts

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
old-commit-hash: 8d6f49aecf
2022-03-02 20:52:17 -08:00
George Hotz
c975d35f49 minor cleanups, fix non binary compile (#23882)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 825c924c1c
2022-03-01 16:05:44 -08:00
Adeeb Shihadeh
2e91f016bb modeld: remove support for small model (#23803)
* modeld: remove support for small model

* use extra
old-commit-hash: 8a19d9892e
2022-02-28 10:32:39 -08:00
Comma Device
ed59474387 THNEED_DEBUG env var support
old-commit-hash: 83159a09bf
2022-02-28 09:30:43 -08:00
HaraldSchafer
fc042cd85a Fix tici bigmodel (#23817)
* Fix bigmodel on tici: cam intrinsics arent static

* Give TICI route own name for import

* Make function useable in offline test

* typo

* change tici ecam focal to trained focal

* No shadow variable

* Fixed ref

* Force update this time

* Update model replay ref commit
old-commit-hash: 48154703a7
2022-02-21 19:57:04 -08:00
Comma Device
123fd2f6ee thneed: a few asserts in the optimizer for cases it will fail
old-commit-hash: 2b652605a0
2022-02-21 12:08:52 -08:00
George Hotz
c033732242 Refactor convolutions (#23807)
* one conv with defines

* add conv

* building works on C3

* this is num_outputs too, process replay is so useful

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2c7542d34e
2022-02-20 11:55:23 -08:00
Willem Melching
ad5ccabce3 bigmodel (#23684)
* Added wide cam vipc client and bigmodel transform logic

* Added wide_frame to ModelState, should still work normally

* Refactored image input into addImage method, should still work normally

* Updated thneed/compile.cc

* Bigmodel, untested: 44f83118-b375-4d4c-ae12-2017124f0cf4/200

* Have to initialize extra buffer in SNPEModel

* Default paramater value in the wrong place I think

* Move USE_EXTRA to SConscript

* New model: 6c34d59a-acc3-4877-84bd-904c10745ba6/250

* move use extra check to runtime, not on C2

* this is always true

* more C2 checks

* log if frames are out of sync

* more logging on no frame

* store in pointer

* print sof

* add sync logic

* log based on sof difference as well

* keep both models

* less assumptions

* define above thneed

* typo

* simplify

* no need for second client is main is already wide

* more comments update

* no optional reference

* more logging to debug lags

* add to release files

* both defines

* New model: 6831a77f-2574-4bfb-8077-79b0972a2771/950

* Path offset no longer relevant

* Remove duplicate execute

* Moved bigmodel back to big_supercombo.dlc

* add wide vipc stream

* Tici must be tici

* Needs state too

* add wide cam support to model replay

* handle syncing better

* ugh, c2

* print that

* handle ecam lag

* skip first one

* so close

* update refs

Co-authored-by: mitchellgoffpc <mitchellgoffpc@gmail.com>
Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 85efde269d
2022-02-19 16:06:31 -08:00
redacid95
fac6a207f9 Snpemodel: Clean up after #23772 (#23780)
* #clean up snpemodel after #23772

* Leave benchmark remove loop
old-commit-hash: 1c9bf108af
2022-02-16 09:40:32 -08:00
George Hotz
37349c0fef add thneed optimizer (#23772)
* add thneed optimizer

* local work group opt

* kernels and final mods

* release files

* build system touchups

* fix kernel path, rand inputs for self test

* broken since extra is gone

* update model replay ref

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 90beaebefb
2022-02-15 15:32:00 -08:00
Dean Lee
70e06287f7 posenet_publish: use const references (#23310)
old-commit-hash: 1fc1382480
2021-12-27 13:31:42 -08:00
Dean Lee
de3f8d227b modeld: update live calibration in main thread (#23235)
* update live calibration in main thread

* static ground_from_medmodel_frame

* more static

* cleanup

* no lambda

* trigger ci
old-commit-hash: ffc2f64f19
2021-12-17 12:29:59 -08:00
Ewout ter Hoeven
a962365292 Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01:00
Dean Lee
0e0c8c9941 modeld: make valid variable thread safe (#23228)
old-commit-hash: 7c4855a609
2021-12-15 14:01:11 +01:00
Dean Lee
b547e87f17 driving.h: remove obsolete poly_fit function prototype (#23229)
old-commit-hash: f20d53b15c
2021-12-15 14:00:46 +01:00
Adeeb Shihadeh
ea2dcf9d37 modeld: start publishing before calib seen (#23190)
old-commit-hash: fa62b9d3f9
2021-12-14 17:04:40 -08:00
Dean Lee
ad8ab75ede commonmodel.h: move global model size into class ModelFrame (#23193)
* move to class ModelFrame

* remove defines in dmonitoring as well

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 13ad02bc06
2021-12-13 14:58:21 +01:00
Dean Lee
dd7c226097 util: move all functions into util namespace (#23203)
old-commit-hash: 9decd3d8a2
2021-12-12 14:42:23 -08:00
Greg Hogan
f1f2a52a5c model output struct for metadata (#23139)
* model output struct for metadata

* better max element search

* ModelDataRawDesireProb.to_array()

* eliminate some copies

* not worth messing with softmax now

* remove unused includes

* more cleanup

* no longer pointers

* better variable name

* fix recurrent state

* improve variable name

* fix OUTPUT_SIZE and NET_OUTPUT_SIZE
old-commit-hash: 40d2e4ec90
2021-12-12 11:41:25 -08:00
Willem Melching
bc267926ce dmonitoring/DriverView: get crop_rect & transform by video size (#23169)
* dmonitoring/DriverView: get crop_rect & transform by video size (#23014)

* keep rounding the same

Co-authored-by: Dean Lee <deanlee3@gmail.com>
old-commit-hash: f93d89b888
2021-12-09 16:20:50 +01:00
Willem Melching
f44ac2a806 Revert "dmonitoring/DriverView: get crop_rect & transform by video size (#23014)"
This reverts commit e312313d5c75a3914cdabc6e1382df602b005c84.

old-commit-hash: b5fdf646ff
2021-12-08 19:13:38 +01:00
Dean Lee
1e45fe1ee7 dmonitoring/DriverView: get crop_rect & transform by video size (#23014)
old-commit-hash: 1af715d6a2
2021-12-08 17:51:56 +01:00
jimw
ce83b94fa6 PC: fix onnxruntime excessive CPU (#23051)
* onnxruntime-gpu two threads

* relock pipfile

Co-authored-by: jwolffe <wolffja@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: db9ea45cd5
2021-12-06 16:51:45 +01:00
grekiki
9e4cc1f7ff Python: Replace more lists with generators (#23116)
* Replace lists with generators v2

* Replace set with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Replace more set() with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 6951b3271d
2021-12-03 22:57:19 -08:00
Dean Lee
9b0fcaeb84 rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 348d2d2b0d
2021-11-29 18:14:59 -08:00
Dean Lee
a80999fd4f moded/RunModel: fix possible memory leak without a virtual destructor (#22990)
old-commit-hash: d97ad1302a
2021-11-20 11:41:24 -08:00
ZwX1616
fc1954492b dmonitoringmodeld: fix black padding not black after libyuv.I420Scale (#22971)
* true black

* set black once

* move def

* add commnet

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 80940b9844
2021-11-19 12:16:23 -08:00
Dean Lee
4411f90df0 driving.cc: const reference the return value of get_best_prediction (#22797)
old-commit-hash: fe22a3563c
2021-11-05 15:07:44 -07:00
Willem Melching
9d65df9048 util.h has conflicting ioctl def on comma two
old-commit-hash: c2b95ca6a1
2021-11-04 16:46:38 +01:00
Dean Lee
6677f91e9d thneed/serialize: use funtions from clutil(#22760)
old-commit-hash: 177c3b89b6
2021-11-04 16:19:25 +01:00
Dean Lee
7ff2217c8b util: remove function to_hex (#22792)
old-commit-hash: ff33ca3413
2021-11-04 16:18:01 +01:00
Willem Melching
19deb98bc3 wshadow: fix comma three build
old-commit-hash: 45c506bb17
2021-11-02 17:27:34 +01:00
Mayfield
43e1903073 enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5246f0231e
2021-11-02 17:08:53 +01:00
Dean Lee
0ce639aa3c thneed: use util::read_file to read from the file (#22757)
old-commit-hash: 07ad6d7444
2021-11-01 11:07:28 +01:00
Adeeb Shihadeh
bb7751fdb0 don't set core affinity on PC (#22706)
old-commit-hash: 5b331fd6f5
2021-10-26 21:51:46 -07:00
Greg Hogan
466288eff0 ModelDataRaw struct part 4 (#22673)
* convert model data for leads to struct

* make things more consistent

* change names with path to plan

* consistent use of plural
old-commit-hash: 7bb13acc45
2021-10-25 16:46:09 -07:00
Greg Hogan
cab0fbed7e ModelDataRaw struct part 3 (#22639)
* lane lines and road edges

* roll back some changes to find what broke things

* rollback more changes to find issue

* fix order of lane line probs

* try outputs on stack again

* initialize output array
old-commit-hash: 755a0a63a2
2021-10-21 14:59:07 -07:00
Greg Hogan
0e89533b19 ModelDataRaw struct part 2 (#22554)
* model pose more struct

* constexpr seems useful

* more concise

* fix order

* seems more readable

* plan struct

* attempt to fix compiling on device

* fix constexpr errors on device

* fix rotation rate in log

* maybe this fixes compiling constexpr on device

* exp() cannot be used in constexpr on c2

* only copy what we actually log

* simplify pivot()

* fix setting position std

* see if this works

* try lambda again

* giving up on the lambda to select member

* fix position std

* fix param order
old-commit-hash: a7f36c9daf
2021-10-19 19:04:01 -07:00
Adeeb Shihadeh
25cfa2b65a tici: affine loggerd to efficiency cores (#22581)
old-commit-hash: 84de248fa7
2021-10-18 13:21:24 -07:00
Greg Hogan
961ca7d880 model position std should be exp(std) (#22593)
old-commit-hash: c1c402a821
2021-10-17 19:42:20 -07:00
Greg Hogan
45d9f8ecc2 ModelDataRaw struct with fixed size arrays (#22544)
* convert pose

* fix indexes
old-commit-hash: 21e58f9f4a
2021-10-13 20:03:15 -07:00
Dean Lee
535550540f modeld: more readable fill_model (#22540)
* more readable fill plan_t_attr

* remove parameter column_offset from fill_xyzt
old-commit-hash: ac9bef1f64
2021-10-13 19:01:08 -07:00
ZwX1616
d4cbef299b wider FOV DM on comma three (#22286)
* c3 is straightforward

* c2 transform

* c3 preview

* alpha model

* Revert "alpha model": wrong quantization data

This reverts commit b50e5739735b30d960aca22bcf3cbe23b0121e13.

* yuv looks good

* a55b

* const int

* block top deadzone

* new box alpha curve

* update k

* fix debug

* rhd use same offset

* box shift for rhd

* 7e3e

* set new thresh

* update ref

* explain

* remove e2e

* same metric thresh

* process isocc

* model

* cancel extra policy

* update numbers

* new model

* update cereal

* up cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 8574e79fec
2021-10-13 17:00:46 -07:00
HaraldSchafer
b1ad3e4e8b more readable (#22519)
old-commit-hash: 0885790e34
2021-10-11 14:20:44 -07:00
HaraldSchafer
4814c30667 ACADOS fix non-convergence when long_plan changes (#22495)
* debug commit

* cleanup

* some indexing bugs

* need more its

* BALANCE is way better it seems

* fix test

* this converges in 2000segs

* new ref

* less cpu
old-commit-hash: 04cf12cb00
2021-10-10 00:05:29 -07:00
Adeeb Shihadeh
782d7023d2 phonelibs -> third_party (#22477)
* git mv to third_party

* find and replace

* fix release tests

* update pre-commit

* update tici bins

* update eon bins

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5b641379ae
2021-10-07 16:32:44 -07:00
HaraldSchafer
db0c802df0 Improved lead model: 6be443f2-ed70-4580-9c31-61b94d068e24/950 (#22290)
* 6be443f2-ed70-4580-9c31-61b94d068e24/950

* meta changed too

* new ref

* new ref from CI

* unused

* Revert "new ref from CI"

This reverts commit 28b6bdc81055c39973d0bf9cc964647838b73a73.

* new ref from CI again
old-commit-hash: 72a736f90e
2021-09-21 17:36:05 -07:00
George Hotz
b4adcd2e56 Use thneed directly on the loaded YUV data (#22236)
* completely untested

* it builds now

* bug fixes, save 1ms

* using a kernel to copy works

* more sane API to loadyuv

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 83ff9ca331
2021-09-16 14:13:03 -07:00
Dean Lee
a02ecc02c4 ONNXModel: use the actual model file name (#22084)
* use the actual file name

* use macro

* fix typo

* continue

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 7db04ab0c5
2021-09-02 14:21:15 -07:00