Commit Graph

293 Commits (master)

Author SHA1 Message Date
ZwX1616 de4031c98e
DM: more precision running on DSP + e2e outputs (#23900)
* update cereal

* run but not use

* log distraction type

* regression scaling

* clean up naming

* add calib buf

* add to header

* fake model

* no calib model

* adjust threshs

* 018a305f

* fix bn

* tweak1

* tweak2

* 0ff2/666

* tweak3

* t4

* t5

* fix out of bound

* skip when replaying old segments

* update ref

* fix onnxmodel

* get calib

* update model replay refs

* up ref
2022-03-15 19:02:21 -07:00
George Hotz 5c5a56c5e6
thneed: a more sane way of doing record/debug (#23938)
Co-authored-by: Comma Device <device@comma.ai>
2022-03-10 16:33:35 -08:00
Willem Melching 492398826f
modeld: sync based on frame timestamp (#23901)
* sync based on frame ts

* log extra frame id

* ints only

* update ref

* no rounding errors
2022-03-07 10:46:15 +01:00
George Hotz 8d6f49aecf
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>
2022-03-02 20:52:17 -08:00
George Hotz 825c924c1c
minor cleanups, fix non binary compile (#23882)
Co-authored-by: Comma Device <device@comma.ai>
2022-03-01 16:05:44 -08:00
Adeeb Shihadeh 8a19d9892e
modeld: remove support for small model (#23803)
* modeld: remove support for small model

* use extra
2022-02-28 10:32:39 -08:00
Comma Device 83159a09bf THNEED_DEBUG env var support 2022-02-28 09:30:43 -08:00
HaraldSchafer 48154703a7
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
2022-02-21 19:57:04 -08:00
Comma Device 2b652605a0 thneed: a few asserts in the optimizer for cases it will fail 2022-02-21 12:08:52 -08:00
George Hotz 2c7542d34e
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>
2022-02-20 11:55:23 -08:00
Willem Melching 85efde269d
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>
2022-02-19 16:06:31 -08:00
redacid95 1c9bf108af
Snpemodel: Clean up after #23772 (#23780)
* #clean up snpemodel after #23772

* Leave benchmark remove loop
2022-02-16 09:40:32 -08:00
George Hotz 90beaebefb
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>
2022-02-15 15:32:00 -08:00
Dean Lee 1fc1382480
posenet_publish: use const references (#23310) 2021-12-27 13:31:42 -08:00
Dean Lee ffc2f64f19
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
2021-12-17 12:29:59 -08:00
Ewout ter Hoeven 55390d273f
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>
2021-12-16 14:58:17 +01:00
Dean Lee 7c4855a609
modeld: make valid variable thread safe (#23228) 2021-12-15 14:01:11 +01:00
Dean Lee f20d53b15c
driving.h: remove obsolete poly_fit function prototype (#23229) 2021-12-15 14:00:46 +01:00
Adeeb Shihadeh fa62b9d3f9
modeld: start publishing before calib seen (#23190) 2021-12-14 17:04:40 -08:00
Dean Lee 13ad02bc06
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>
2021-12-13 14:58:21 +01:00
Dean Lee 9decd3d8a2
util: move all functions into util namespace (#23203) 2021-12-12 14:42:23 -08:00
Greg Hogan 40d2e4ec90
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
2021-12-12 11:41:25 -08:00
Willem Melching f93d89b888
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>
2021-12-09 16:20:50 +01:00
Willem Melching b5fdf646ff Revert "dmonitoring/DriverView: get crop_rect & transform by video size (#23014)"
This reverts commit 1af715d6a2.
2021-12-08 19:13:38 +01:00
Dean Lee 1af715d6a2
dmonitoring/DriverView: get crop_rect & transform by video size (#23014) 2021-12-08 17:51:56 +01:00
jimw db9ea45cd5
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>
2021-12-06 16:51:45 +01:00
grekiki 6951b3271d
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>
2021-12-03 22:57:19 -08:00
Dean Lee 348d2d2b0d
rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-29 18:14:59 -08:00
Dean Lee d97ad1302a
moded/RunModel: fix possible memory leak without a virtual destructor (#22990) 2021-11-20 11:41:24 -08:00
ZwX1616 80940b9844
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>
2021-11-19 12:16:23 -08:00
Dean Lee fe22a3563c
driving.cc: const reference the return value of get_best_prediction (#22797) 2021-11-05 15:07:44 -07:00
Willem Melching c2b95ca6a1 util.h has conflicting ioctl def on comma two 2021-11-04 16:46:38 +01:00
Dean Lee 177c3b89b6
thneed/serialize: use funtions from clutil(#22760) 2021-11-04 16:19:25 +01:00
Dean Lee ff33ca3413
util: remove function to_hex (#22792) 2021-11-04 16:18:01 +01:00
Willem Melching 45c506bb17 wshadow: fix comma three build 2021-11-02 17:27:34 +01:00
Mayfield 5246f0231e
enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-02 17:08:53 +01:00
Dean Lee 07ad6d7444
thneed: use util::read_file to read from the file (#22757) 2021-11-01 11:07:28 +01:00
Adeeb Shihadeh 5b331fd6f5
don't set core affinity on PC (#22706) 2021-10-26 21:51:46 -07:00
Greg Hogan 7bb13acc45
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
2021-10-25 16:46:09 -07:00
Greg Hogan 755a0a63a2
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
2021-10-21 14:59:07 -07:00
Greg Hogan a7f36c9daf
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
2021-10-19 19:04:01 -07:00
Adeeb Shihadeh 84de248fa7
tici: affine loggerd to efficiency cores (#22581) 2021-10-18 13:21:24 -07:00
Greg Hogan c1c402a821
model position std should be exp(std) (#22593) 2021-10-17 19:42:20 -07:00
Greg Hogan 21e58f9f4a
ModelDataRaw struct with fixed size arrays (#22544)
* convert pose

* fix indexes
2021-10-13 20:03:15 -07:00
Dean Lee ac9bef1f64
modeld: more readable fill_model (#22540)
* more readable fill plan_t_attr

* remove parameter column_offset from fill_xyzt
2021-10-13 19:01:08 -07:00
ZwX1616 8574e79fec
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 b50e573973.

* 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>
2021-10-13 17:00:46 -07:00
HaraldSchafer 0885790e34
more readable (#22519) 2021-10-11 14:20:44 -07:00
HaraldSchafer 04cf12cb00
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
2021-10-10 00:05:29 -07:00
Adeeb Shihadeh 5b641379ae
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>
2021-10-07 16:32:44 -07:00
HaraldSchafer 72a736f90e
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 28b6bdc810.

* new ref from CI again
2021-09-21 17:36:05 -07:00