Commit Graph

8247 Commits

Author SHA1 Message Date
Julien Schueller
14ba5572e7
CMake: Set LAPACK libs as public (#2923) 2024-03-26 19:15:42 -04:00
Adrià Arrufat
c26b1238df
jxl: use float for quality (#2930) 2024-03-13 08:14:59 -04:00
Juha Reunanen
1529b690da
Apply the new patch from Davis (#2929) 2024-03-10 12:59:49 -04:00
Adrià Arrufat
d5909ed977
allow reading and writing rgb-alpha images in Python (#2925) 2024-03-05 20:17:36 -05:00
Adrià Arrufat
d45f534d68
Add missing magic number for JPEG XL (#2924)
* Add missing magic number for JPEG XL

* do not force JXL container
2024-03-05 20:15:10 -05:00
Adrià Arrufat
9a30c6d48f
Add JXL support (#2917)
* WIP: preparation for JPEG XL support

* jxl: add loading support

* update jxl abstract

* add support for saving jxl (lossless not working)

* everything works except setting lossless explicitly

* remove unused header

* fix wrong quality logic

* remove debugging statements

* fix lossless encoding

* improve support for grayscale images

* use JXL instead of JPEGXL everywhere

* oops do not make libjxl a requirement

* update years

* silence some warnings

* simplify loader fast path logic

* allow python to save jxl and webp

* update error message with supported formats

* Allow setting image quality in Python

The setting is ignored where it does not make sense.

* round quality in JPEG saver

* improve error message in CMake

* add jxl support to imglab

* add Davis's suggestion

Co-authored-by: Davis E. King <davis685@gmail.com>

* Apply suggestions from code review

Co-authored-by: Davis E. King <davis685@gmail.com>

* make sure grayscale is 8 bit

* update abstract: JPEG XL can store grayscale images

* add more methods to query basic info from JXL

* documentation formatting

* Apply Davis' suggestions

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2024-03-04 07:56:31 -05:00
Adrià Arrufat
c7ba757bc1
add nr and nc methods to jpeg, png and webp loaders (#2920)
* add nr and nc methods to jpeg, png and webp loaders

* Oops, forgot to declare methods in jpeg_loader.h
2024-03-04 07:30:18 -05:00
pfeatherstone
405536051b
Use STD in testing suite (#2922)
* use std

* make gcc happy

---------

Co-authored-by: pfeatherstone <pfeatherstone@pf>
2024-03-04 07:29:17 -05:00
Adrià Arrufat
3d3bd7cee1
Fix documentation of inv_color_transform (#2918) 2024-02-28 19:44:24 -05:00
Adrià Arrufat
f775b55cd9
Add color transform and inv color transform (#2914)
* add color transform

* simplify inv_color_transform

* fix typo

* Update dlib/image_transforms/random_color_transform.h

* Update dlib/image_transforms/random_color_transform.h

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2024-02-21 06:44:15 -05:00
Adrià Arrufat
631c47c7fd
fix letterbox_image in yolo example (#2911) 2024-02-05 08:07:16 -05:00
Adrià Arrufat
85aa29a4e8
Return shortcut in disturb_colors (#2909)
* Return shortcut in disturb_colors

No need to do anything if both gamma and color magnitudes are set to 0.

* Fix typo

This happens for being lazy and making the change directly from GitHub...
2024-01-28 10:04:12 -05:00
Adrià Arrufat
b0f6be8058
loss_barlow_twins: add get_eccm member function (#2906)
This allows us to greatly simplify the self supervised learning example:
- the computation in user code was a bit too distracting
- avoids duplicated computation/allocation of this matrix
- avoids edge case where net outputs are zero due to trainer synchronization
2024-01-08 21:59:09 -05:00
Davis E. King
46e59a2174
Disable mac osx CI 2023-12-07 22:28:12 -05:00
Adrià Arrufat
19a952c3a4
extend letterbox behavior (#2899)
* extend letterbox behavior

* simplify scale logic and update docs

* oops, forgot one line in the yolo example

* make dpoint const
2023-12-07 22:22:05 -05:00
Adrià Arrufat
b20e97446b
Add find_convex_hull using Graham scan (#2889) 2023-11-12 20:10:47 -05:00
avkarenow
f7d99ae0dc
Make use of CMAKE_BUILD_PARALLEL_LEVEL (#2879) 2023-10-11 19:39:48 -04:00
avkarenow
13c6b7a5b1
Remove cmake from pyproject.toml (#2878) 2023-10-11 19:00:01 -04:00
pfeatherstone
106c5a265d
[PNG] save_png() now works with std::vector and std::ostream (#2873)
* 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>
2023-10-11 18:54:34 -04:00
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