* save_png() works with buffers and streams
* optimization for bgr_pixel
* explicit overloads for matrix<> and matrix_exp<>. Added docs for new savers
* refactored loading implementations details. In my view, easier to read, mirrors saving implementations details, and supports iostreams. We could make the callback API public, and we could support a ton of APIs...
* test for iostreams
* oops
* - reduced code size by templating byte type
- docs
* spelling
* i hope i haven't made a pig's breakfast out of this
---------
Co-authored-by: pf <pf@me>
* 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>
* 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>
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.
* Fix convolution backward filter cache when using cudnn
* Apply suggestions from code review
---------
Co-authored-by: Davis E. King <davis685@gmail.com>
* 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>
* 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>
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
* 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>
* 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>
* 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>
* 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>
* 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