Commit Graph

8070 Commits

Author SHA1 Message Date
Adrià Arrufat 8ceb91fb44
Do not build WebP features if WebP is not available (#2582) 2022-04-29 08:38:21 -04:00
Davis King e264c26641 Build examples and other ancillary tools on windows too 2022-04-29 07:45:51 -04:00
Adrià Arrufat a7ae55b785
Add WebP support to imglab (#2580)
* Add WebP support to imglab

* Change order in if/else statements for image saving
2022-04-28 20:06:33 -04:00
Juha Reunanen df8b1380ab
Add GitHub Actions badges (#2571) 2022-04-20 08:00:00 -04:00
Juha Reunanen ebc4d63d68
Workaround for #2506 (#2570)
* Do not put variants that can hold immutable types to vectors

* Enable build on gcc 11
2022-04-19 08:02:17 -04:00
Adrià Arrufat a76f205bf6
Add webp support (#2565)
* Add BGR(A) to pixel_traits

* add support for reading webp

* Apply Davis' suggestions and fix formatting

* Fix signed/unsigned warning

* Update decoding paths

* update pixel traits documentation

* Add support for writing WebP images

* Simplify image_saver code

* WIP: add tests, PSNR is low but images look good

* Add lossless compression for quality > 100

* Fix build when WebP support is disabled

* Use C++ stream instead of C-style FILE

* Fix indentation

* Use reinterpret_cast instead of C-style cast

* Improve impl::impl_save_webp signature

* Remove empty line

* Use switch statement and clean up code

* Update Copyright and test libwebp on Linux

* Fix formatting in github workflow

* Fix operator== for bgr_alpha_pixel

* Show where the test fails

* Add libwebp to CI for the remaining Linux workflows

* Use filename consistently

* Improve message with wrong pixel type

* Fix tests for WebP images

* Prevent saving images which are too large and improve error messages

* Use max dimension from WebP header directly

* Update documentation, index and release notes

* Update dlib/image_saver/save_webp_abstract.h

Co-authored-by: Martin T. H. Sandsmark <martin.sandsmark@kde.org>
Co-authored-by: Davis E. King <davis685@gmail.com>
2022-04-19 07:52:12 -04:00
Juha Reunanen 0aa8b4cbfc
Treat warnings as errors (#2490) 2022-04-12 18:53:52 -04:00
Adrià Arrufat 49314c12d9 Use CUDA in LayerNorm gradient computation
I don't know how I could miss this.
2022-04-12 08:22:43 -04:00
Adrià Arrufat 3a267db577 Fix entry in term_index.html 2022-04-12 08:22:13 -04:00
Adrià Arrufat 45f742b82b Update docs 2022-04-12 08:22:13 -04:00
Adrià Arrufat e944ea4fcb Update dot visitor 2022-04-12 08:22:13 -04:00
Adrià Arrufat 18fe54b64a fix smelu_gradient name 2022-04-12 08:22:13 -04:00
Adrià Arrufat 8fa65eb7b2 Add SmeLU activation 2022-04-12 08:22:13 -04:00
Adrià Arrufat 66f9b2b5bc Fix documentation 2022-04-06 22:37:52 -04:00
Adrià Arrufat 23c74af872 Add directory_exists 2022-04-06 22:37:52 -04:00
Adrià Arrufat 9bb1b6f712 Fix focal loss
The loss value should reflect the impact of the gamma parameter, as well.
2022-03-30 19:38:56 -04:00
Øystein Myrmo 5cb036564c Make Clang compile cpp11_test.cpp without warnings
Warnings about unused variables are quenched by simply incrementing the
variables in question. This makes the try_compile() call in CMake
succeed without warnings when checking for C++11 compatibility and using
-Wall.
2022-03-23 08:44:27 -04:00
Øystein Myrmo e9d49fee8f Print reason for failing to compile cpp11_test 2022-03-23 08:44:27 -04:00
Øystein Myrmo 04d1180b02 Make compiler options work with clang-cl
When propagating the option "-Xclang -fcxx-exceptions" to targets
linking to dlib, the options with quotes are unknown to clang-cl.
Removing the quotes and splitting the arguments into two works fine.
2022-03-23 08:44:27 -04:00
Øystein Myrmo 04371157f7 Increase template-depth for Clang only when needed
Clang 7 increased the default template-depth to 1024.
2022-03-23 08:44:27 -04:00
Øystein Myrmo 4ebf3ef088 Only print Visual Studio messages when compiling with MSVC
When compiling with other compilers than MSVC, error messages about
C++11 support for versions below MSVC version 19.0.24210.0 were printed.
This happens, for example, when using clang-cl installed with the Visual
Studio Installer.
2022-03-23 08:44:27 -04:00
Adrià Arrufat 3b518f40ce
Fix deserialize logic in loss_multibinary_log (#2547) 2022-03-23 07:35:56 -04:00
Adrià Arrufat 1b7053fe9d
Add focal gamma to loss_multibinary_log (#2546)
* Add focal gamma to loss_multibinary_log

* update release notes
2022-03-21 22:04:21 -04:00
Adrià Arrufat f1a29f3595
Update docs (#2544)
* Update docs

* escape & in git_logs_as_xml
2022-03-14 08:39:42 -04:00
Adrià Arrufat 516b744b43
Add missing vistor implementations to visitors.h (#2539)
Notably, set_all_bn_running_stats_window_sizes and fuse_layers.

But also I took the chance to remove the superflous separators and
change the attribute of upsample layers from stride to scale.
2022-03-10 08:09:53 -05:00
Adrià Arrufat 12f1b3a305
Refactor visitors into their own header (#2533)
* Refactor visitors into their own header

* Update visitor links in term index

* Move documentation from layers_abstract
2022-03-05 07:58:13 -05:00
Adrià Arrufat 736b4931b7
Fix formatting in YOLO deserialize error message (#2535) 2022-03-04 06:28:28 -05:00
Adrià Arrufat 1f9f32ca97
Add visitor to draw nets in the DOT language (#2528)
* Add visitor to draw nets in the DOT language

* Add documentation
2022-03-03 07:20:24 -05:00
Juha Reunanen bf427f56c7
Problem: `Error while calling cudnnGetConvolutionForwardWorkspaceSize( context(), descriptor(data), (const cudnnFilterDescriptor_t)filter_handle, (const cudnnConvolutionDescriptor_t)conv_handle, descriptor(dest_desc), (cudnnConvolutionFwdAlgo_t)forward_algo, &forward_workspace_size_in_bytes) in file C:\a\2\s\3rdparty\dlib\dlib\cuda\cudnn_dlibapi.cpp:1029. code: 9, reason: CUDNN_STATUS_NOT_SUPPORTED` (#2532)
Solution: when this happens, select the best algorithms again - but this time bypassing the cache
2022-03-03 07:18:35 -05:00
Davis King 5f7e19b785 remove cruft 2022-02-28 07:49:23 -05:00
APTX 8928f477de
Find Threads target if necessary (#2522) (#2526) 2022-02-27 09:34:09 -05:00
Davis King 0f1b2b37fe update cmake docs 2022-02-26 20:13:49 -05:00
Juha Reunanen efa2baee7b
Problem: Error while calling cudnnGetConvolutionBackwardFilterWorkspaceSize( context(), descriptor(data), descriptor(dest_desc), (const cudnnConvolutionDescriptor_t)conv_handle, (const cudnnFilterDescriptor_t)filter_handle, (cudnnConvolutionBwdFilterAlgo_t)backward_filters_algo, &backward_filters_workspace_size_in_bytes) in file C:\a\1\s\3rdparty\dlib\dlib\cuda\cudnn_dlibapi.cpp:1048. code: 9, reason: CUDNN_STATUS_NOT_SUPPORTED (#2527)
Solution: Do not apply the cuDNN 5.1 workaround if we have cuDNN version greater than or equal to 7
2022-02-26 19:52:34 -05:00
Adrià Arrufat 1ccd03fec9
Speed up Barlow Twins loss (#2519) 2022-02-24 22:42:50 -05:00
Adrià Arrufat 50b78da53a
Fix Barlow Twins loss gradient (#2518)
* Fix Barlow Twins loss gradient

* Update reference test accuracy after fix

* Round the empirical cross-correlation matrix

Just a tiny modification that allows the values to actually reach 255 (perfect white).
2022-02-21 08:33:21 -05:00
Davis King 39852f092c fix race condition in sockets unit test 2022-02-21 08:31:40 -05:00
Davis King c7ed14c956 Adjust debugging message from sockets test 2022-02-20 19:05:54 -05:00
Davis E. King f80703e8e6
Make github actions run the python unit tests (#2517)
* Make github actions run the python unit tests

* why don't the pyhton tests run?

* run python tests

* don't run tests twice

* don't run cmake tests twice

* rename the CMake test to C++ since it's testing the C++ part of the library

And the python build uses cmake too, which makes the naming somewhat
confusing

* work around macos

* oops, fix spelling error
2022-02-20 19:05:02 -05:00
Davis King c0382b41c1 Add debugging message to see why the socket tests sometimes fail on windows in github actions 2022-02-20 18:22:58 -05:00
Ryan_Huang 7e942ba989
Update __init__.py.in (#2515) 2022-02-18 08:50:55 -05:00
Juha Reunanen 7be763d65e
Make GitHub actions build on gcc-11 and clang too (#2510)
* Refactor not to use a matrix

* Add clang build

* Add job on clang-13 as well

* Disable the `gcc-11` job for now
2022-02-13 12:06:04 -05:00
Adrià Arrufat 7f8731a240
Add get_random_beta to dlib::rand (#2499)
* Add get_random_beta

* simplify beta distribution generation

* add tests

* fix condition and use full names for shape parameters

* remove unneeded include

* match test types to prevent Windows from failing tests

* Revert "remove unneeded include"

This reverts commit 35f55a96e9.

* Revert "match test types to prevent Windows from failing tests"

This reverts commit a990307066.

* Revert "Revert "remove unneeded include""

This reverts commit 59be002c9e.

* fix outdated message in DLIB_CASSERT

* relax mpc condition again

* Revert "relax mpc condition again"

This reverts commit 1d208c5dcf.

* Loop while both alpha and beta are zero

* Update dlib/rand/rand_kernel_abstract.h

Co-authored-by: Davis E. King <davis685@gmail.com>
2022-02-12 09:28:34 -05:00
Juha Reunanen 48f1167991
Do not use deprecated `std::random_shuffle` (#2507) 2022-02-12 09:16:51 -05:00
Adrià Arrufat d665bfb899
try to fix build on macOS (#2503) 2022-02-06 22:26:31 -05:00
Davis King 5291d58e93 See if this makes the MPC test more reliable on MacOS 2022-02-06 21:36:56 -05:00
Davis King c89bf6b77a try less parallelism and see if that doesn't break github actions 2022-02-06 21:28:24 -05:00
Davis King 42c74c38a1 use parallel builds for github actions 2022-02-06 19:48:18 -05:00
Juha Reunanen 979a22c51d
Make Github Actions build more stuff (in particular, the examples) (#2502) 2022-02-06 19:47:05 -05:00
Davis King 7048f4c1d4 Avoid build error in visual studio 2022-02-03 23:14:36 -05:00
Davis King fda984f7ca Add more unit tests for dlib::rand 2022-02-03 08:45:15 -05:00