Commit Graph

8228 Commits

Author SHA1 Message Date
pfeatherstone
3624bf9f05
[scope] Adding scope_exit (#2875)
* initial commit

* is this enough?

* is this enough docs? I'm not great at writing docs

---------

Co-authored-by: pf <pf@me>
Co-authored-by: pf <pf@pf>
2023-10-06 22:57:11 -04:00
pfeatherstone
afede571cb
potential fix for gcc 5.1 onward (#2870)
Co-authored-by: Your Name <you@example.com>
2023-09-30 11:11:13 +00:00
Davis King
57b77a0e41 fix incorrect assert and typo in docs 2023-09-24 15:05:33 -04:00
pfeatherstone
b74a6710d1
simplify and fix bug (#2866) 2023-09-20 07:07:36 -04:00
pfeatherstone
dad29bfae7
Apple Clang complains about sprintf. Use snprintf instead. (#2862)
Co-authored-by: Your Name <you@example.com>
2023-09-19 08:12:02 -04:00
pfeatherstone
c53ff25952
bug fix when multiple streams are present (#2863)
Co-authored-by: Your Name <you@example.com>
2023-09-19 08:09:55 -04:00
Davis King
4161cc3017 oops, fix build error 2023-09-17 21:34:25 -04:00
Davis King
1ffab7c210 update docs and some cleanup 2023-09-17 21:26:29 -04:00
Marc Paterno
b4acae25a2
Apply archiver flags only on Apple using Apple compilers (#2854) 2023-09-12 08:30:58 -04:00
Davis E. King
f6c58c2d21
Make type safe union docs more clear regarding exceptions. 2023-08-26 19:55:59 -04:00
Davis King
c6c865ba71 Make test threshold a little more robust. 1e-6 was right on the edge and sometimes failed. 2023-08-06 09:33:09 -04:00
Facundo Galán
be2fa7f93c
Add fuse layers for conv+affine+relu and conv+relu (#2842)
* Add fuse layers for conv+affine+relu and conv+relu

* Add relu to tensor_conv for cpu

* Update convolution serialization

* Move disable_duplicative_biases documentation from layers_abstract to visitors_abstract

* Fix convolution copy

* Update dlib/dnn/layers_abstract.h

---------

Co-authored-by: Facundo Galan <fgalan@danaide.com.ar>
Co-authored-by: Davis E. King <davis685@gmail.com>
2023-08-05 12:38:29 -04:00
Davis King
efae642813 Work around bug in gcc 11.4.0 causing spurious compile error 2023-08-05 12:24:42 -04:00
Prashanth
9a9b4af6c5
updated cudnn path (#2843)
* updated cudnn path

* adding cudnn path

* Use same format as command below

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2023-08-05 09:39:56 -04:00
Davis King
ba66152ad9 Add filter rules for matlab CI 2023-07-27 20:19:39 -04:00
Davis King
efaa213b6e remove clang 13 CI since the install method isn't working anymore and we have another test for clang 2023-07-27 20:18:13 -04:00
Facundo Galán
c7b2917498
Perform conv with bias for specific algo with cudnn (#2839) 2023-07-27 18:11:32 -04:00
Adrià Arrufat
7b6021eee7
Only trigger CI when relevant files are changed (#2836) 2023-07-23 09:02:21 -04:00
Davis E. King
a50bd167c4
Setup CI for the mex wrapper code (#2834)
* Setup CI for the mex wrapper code
2023-07-21 11:48:29 -04:00
Adrià Arrufat
f395234aa4
Update bug.yml (#2835)
When I created the issue template, I was expecting that we would get fewer people opening bugs when they can't build dlib, so I added the bug label to all submitted bugs.

However, that is not the case, and we still get bug reports which are not really bugs, and this label prevents the @dlib-issue-bot from closing them if there's no activity.

I think the bug label should only be added manually after verifying that the bug report is actually a bug.
2023-07-21 11:16:22 -04:00
Davis King
3cca5df0fd Add sig_traits back since the matlab wrapper depedned on it. 2023-07-21 08:19:09 -04:00
Facundo Galán
3f9c5c1cfd
Fix convolution backward filter cache when using cudnn 7 and above (#2828)
* Fix convolution backward filter cache when using cudnn

* Apply suggestions from code review

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2023-07-17 07:53:32 -04:00
Facundo Galán
7736832caf
Optimize pointer to matrix assignment (#2822)
* Optimize pointer to matrix assignment

---------

Co-authored-by: Davis King <davis@dlib.net>
2023-07-16 15:27:59 -04:00
Adrià Arrufat
8fc180545c
Python: Add grayscale overloads to get_face_chip (#2820)
Closes #2736.
2023-07-10 08:25:58 -04:00
pfeatherstone
4e22715eb5
dlib::optional (#2815)
* backport of std::optional for c++11. WIP

* wip

* whoops

* wip

* wip

* holy shit this is tiring

* type traits

* more traits

* more traits

* wip

* delimiters

* bad header include

* noexcept correctness

* fixed has_value()
more tests

* started adding monadic intefaces

* compile time contract

* added transform

* added or_else

* according to the standard, swap also empties objects when necessary

* noexcept tests

* beginning monad tests

* bug fix

* contexpr monads

* added docs

* more tests and bug fixes

* - bug fix
- test inplace constructors and emplace()

* test value_or()

* more tests

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Your Name <you@example.com>
2023-07-08 09:12:56 -04:00
Julien Schueller
4d2db66cc5
Make cblas public (#2817) 2023-06-29 08:24:07 -04:00
Null Chilly
18927f93e2
Fix typos (#2811) 2023-06-11 20:21:05 -04:00
Rover van der Noort
bebba4ca98
Add minimal pyproject.toml (#2804)
* Add minimal pyproject.toml

* Update README for Python compile and install

* Remove duplicate meta

* Fix pixel saturation in interpolate_quadratic (#2806)

* Fix pixel saturation in interpolate_quadratic

* Use pixel_type_t alias

* cleanup

---------

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
Co-authored-by: Davis King <davis@dlib.net>
2023-06-03 16:12:44 -04:00
Adrià Arrufat
759170d3d6
Fix pixel saturation in interpolate_quadratic (#2806)
* Fix pixel saturation in interpolate_quadratic

* Use pixel_type_t alias
2023-06-01 21:52:11 -04:00
pfeatherstone
eccb9675ff
[FFmpeg] added save_frame() and improved picking of codecs when not specified (#2800)
* WIP

* - pick best codec
- added save_frame()
- fixed example

* Add missing variable declaration

* added extensions
fixed tests

* attempt to set quality as high as possible. lower expected PSNR

* arrufat suggestion

* refactoring

---------

Co-authored-by: Your name <you@example.com>
Co-authored-by: pf <pf@me>
Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
2023-05-24 07:46:30 -04:00
Adrià Arrufat
b86871241b
Remove unneeded using namespace std (#2799) 2023-05-18 23:02:46 -04:00
pfeatherstone
5b9ab23cc0
[FFmpeg] added push(image_type) methods to encoder and muxer (#2797)
* added push() methods

* Update dlib/media/ffmpeg_muxer.h

* Update dlib/media/ffmpeg_muxer.h

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Davis E. King <davis685@gmail.com>
2023-05-18 08:11:49 -04:00
pfeatherstone
dab9aa1fa5
missing include (#2798)
Co-authored-by: pf <pf@me>
2023-05-18 08:03:15 -04:00
Juha Reunanen
b6418e349e
Problem: CUDA error having code: 716, reason: misaligned address (#2796)
Why does this happen: `float` data should be aligned to 4 bytes [1], but this is not guaranteed when the truth data is `uint16_t` and is in the buffer before the weights data

Solution: re-arrange the buffer so that the weights data (type `float`) comes before the truth data (type `uint16_t`), essentially making it so that the `float` data is correctly aligned to 4 bytes

[1] https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#device-memory-accesses
2023-05-16 08:03:58 -04:00
pfeatherstone
decdef12f5
[FFmpeg] decoding and demuxing improvements (#2784)
* typo

* - added compile time information to audio object. Not convinced this is needed actually. I'm perfectly happy just using the ffmpeg::frame object. I'm pretty sure I'm the only user who cares about audio.
- created resizing_args and resampling_args

* smaller videos for unit tests

* shorter videos for unit tests

* - decoder and demuxer: you now resize or resample at the time of read. therefore you don't set resizing or resampling parameters in constructor, but you pass them to read()
- added templated read() function
- simplified load_frame()

* inherit from resizing_args and resampling_args

* reorganised the tests to segragate decoding, demuxing, encoding and muxing as much as possible

* much more basic example

* demxing examples split

* examples

* fixing examples

* wip

* Fix load_frame()

* added frame - specific tests

* - makes sense to have a set_params() method rather than constructing a new object and moving. I mean, it works and it absolutely does the right thing, and in fact the same thing as calling set_params() now, but it can look a bit weird.

* notes on defaults and good pairings

* Update ffmpeg_demuxer.h

Watch out for `DLIB_ASSERT` statements. Maybe one of the unit tests should build with asserts enabled.

* Update ffmpeg_details.h

* Update ffmpeg_muxer.h

* WIP

* WIP

* - simplified details::resizer
- added frame::set_params()
- added frame::clear()
- forward packet directly into correct queue

* pick best codec if not specified

* added image data

* warn when we're choosing an appropriate codec

* test load_frame()

* - for some reason, you sometimes get warning messages about too many b-frames. Resetting pict_type suppresses this.
- you can move freshly decoded frames directly out.

* callback passed to push()

* I think it's prettier this way

* WIP

* full callback API for decoder

* updated tests

* updated example

* check the template parameter is callable and has 1 argument first before getting it's first argument

* Potential bug fix

* - write out the enable_if's explictly. It's fine. I think it's clear what's going on if someone cares
- guard push() with a boolean which asserts when recursion is detected

* pre-conditions on callbacks: no recursion

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Your name <you@example.com>
2023-05-15 21:24:47 -04:00
Davis King
adf8a3573e put patch level back to 99 2023-05-14 09:11:31 -04:00
Davis King
39749fba51 tag v19.24.2 2023-05-14 09:06:12 -04:00
Charles Galambos
e2a0c3dfca
std::chrono::system_time on osx isn't in nanoseconds (#2795)
* Allow the scan parameters to be changed in a detector.

* Fix warning.

* Fix for clang on osx which std::chrono::system_time has a duration in microseconds not nanoseconds. ^

* Revert "Allow the scan parameters to be changed in a detector."

This reverts commit 2a5760aacf.

* Fix second instance.

* Static not needed when inline.

---------

Co-authored-by: Charles Galambos <charles@reactai.com>
Co-authored-by: Davis E. King <davis685@gmail.com>
2023-05-09 10:39:05 -04:00
pfeatherstone
775ac0799f
- moved is_detected in type_traits.h (#2794)
- fixed callable_traits
- added tests

Co-authored-by: pf <pf@me>
2023-05-08 22:39:15 -04:00
pfeatherstone
191d280d64
[Meta] added callable traits (#2790)
* added callable traits

* tests

* use compiler intrinsic if possible

* workaround for gcc < 7.5

* - added nargs
- bug fix - use std::decay_t
- added more tests.
- one of the unit tests show cases why this is cool

* docs

* more docs

* Update dlib/type_traits.h

* Update dlib/type_traits.h

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Davis E. King <davis685@gmail.com>
2023-05-06 19:53:46 -04:00
pfeatherstone
ff331517b9
[FFT] split FFT API into different layers (#2793)
* fft refactoring

* separate header for STL overloads

* ditto

---------

Co-authored-by: pf <pf@me>
2023-05-06 11:43:10 -04:00
Adrià Arrufat
48fdace271
Use dpoint instead of dlib::vector<double, 2> (#2782) 2023-04-22 09:19:58 -04:00
pfeatherstone
74a55fb5c9
FFMPEG : inline docs (#2778) 2023-04-22 07:51:42 -04:00
Adrià Arrufat
edc6645150
Add insert_image_chip (#2781)
* Add insert_image_chip to Python bindings

* Use interpolation

* remove commented code

* Add C++ implementation

* Fix compile error and improve variable namings

* Fix signed warning
2023-04-21 23:55:11 -04:00
pfeatherstone
d41571ea5a
10X speedup (#2779)
Co-authored-by: pf <pf@me>
2023-04-21 23:37:19 -04:00
Adrià Arrufat
49ac2eb3ae
Add draw solid polygon (#2775)
* Add initial version of a generic draw_solid_polygon

* Use image view to be truly generic

* Improve draw_solid_convex_polygon when antialias is disabled

* Remove unused parameter and fix documentation

* Use rectangle methods

* Remove redundant check

* Remove unused variable

* Update dlib/image_transforms/draw.h

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2023-04-21 23:36:02 -04:00
pfeatherstone
53c4be9026
FFmpeg : logging (#2774)
* added a couple more audio examples

* logging DONE

* bug fix on certain compilers

* use a C-style stack allocated array. This reduces heap allocations

* reduce stack string size. replace '\n' rather than remove

* - register_ffmpeg() doesn't need to return anything
- refactored loggers
- added verbose option

* bug fix

* unused variable warning

* Update docs

* Update docs

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
2023-04-19 08:32:19 -04:00
pfeatherstone
5f7026ab52
FFmpeg : improvements to ffmpeg::list() functions (#2773)
* added a couple more audio examples

* statically initialize all list_() functions where possible.

---------

Co-authored-by: pf <pf@me>
2023-04-15 09:28:38 -04:00
Adrià Arrufat
b1fe026e06
Add ffmpeg load_frame (#2770)
* Add ffmpeg::load_frame

* Add ffmpeg::save_frame

* Check for supported encoders

* Add documentation

* Add pfeatherstone suggestions and enable only for RGB images

* Remove the pixel format setting, as it is not needed

* Fix formatting in error message

* Set pixel format in ffmpeg::save_frame

* Fix formatting

* Remove ffmpeg::save_frame
2023-04-14 08:18:25 -04:00
Adrià Arrufat
c21c9c92b5
Update widgets and draw_string on images to use convert_to_utf32 (#2769)
* Remove convert_to_utf32 from imglab by updating widgets methods

* Use convert_to_utf32 in draw_string for images

* Add an overload of draw_string for string literals
2023-04-13 08:48:49 -04:00