Commit Graph

8175 Commits

Author SHA1 Message Date
Adrià Arrufat
252d76f356
Fix outdated comment in self supervised learning example (#2768) 2023-04-12 22:33:34 -04:00
pfeatherstone
9148a47c7e
RTSP example (#2763) 2023-04-09 10:34:31 -04:00
pfeatherstone
7155daeeea
FFmpeg : muxing (#2755)
* muxing

* Add HSV support (#2758)

* Add HSV support

* Add tests

* Update dlib/pixel.h

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>

* Add HSV struct and make more things const

---------

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

* Fix imglab changing the current dir too soon (#2761)

* A bit of cleanup

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
Co-authored-by: Davis E. King <davis685@gmail.com>
Co-authored-by: Davis King <davis@dlib.net>
2023-04-08 14:45:30 -04:00
Adrià Arrufat
004b2fe6fe
Fix imglab changing the current dir too soon (#2761) 2023-04-07 08:08:27 -04:00
Adrià Arrufat
4224951c38
Add HSV support (#2758)
* Add HSV support

* Add tests

* Update dlib/pixel.h

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>

* Add HSV struct and make more things const

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2023-04-05 09:03:12 -04:00
Davis E. King
6893653428
Ubuntu 18.04 Actions runner image is deprecated, use newer image (#2759)
* Ubuntu 18.04 Actions runner image is deprecated, use newer image

See https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/

* make it really use gcc 7
2023-04-04 08:59:27 -04:00
pfeatherstone
937e07e90d
FFmpeg : encoding (#2754)
* docs

* callbacks for encoder

* shorter video

* shorter video

* added is_byte type trait

* leave muxer for next PR

* added overloads for set_layout() and get_layout() in details namespace

* unit test

* example

* build

* overloads for ffmpeg < 5

* Update examples/ffmpeg_video_encoding_ex.cpp

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_abstract.h

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

* as per suggestion

* remove requires clause

* Update examples/ffmpeg_video_encoding_ex.cpp

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

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_abstract.h

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

* Update dlib/media/ffmpeg_muxer.h

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

* use dlib::logger

* oops

* Update dlib/media/ffmpeg_muxer.h

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

* Update dlib/media/ffmpeg_demuxer.h

* Update dlib/media/ffmpeg_demuxer.h

* Update dlib/media/ffmpeg_abstract.h

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Davis E. King <davis685@gmail.com>
Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
2023-04-01 09:48:26 -04:00
pfeatherstone
f586d0a552
FFMPEG : misc + ffmpeg5 support (#2746)
* - enhanced list_muxers()
- added fail() error handling helper function
- moved framerate setting to decoder_image_args

* docs

* oops

* - don't use std::endl, use `\n` instead
- use fail(). See, on average, it removes lines of code

* convenient constructor for demuxer

* ffmpeg5 support

* added docs for == -1

* oops

* grouping audio channel compatibility stuff together

* more compatibility stuff

* more channel abstractions

* build with ffmpeg 5

* install assembler

* cache the installation

* cmake doesn't like using ~ in filepath

* at some point this will work

* i think i need to change the key

* test FFmpeg-n5.1.3_try3 cache

* bug fix

* Update build_cpp.yml

Giving this another go

* Update build_cpp.yml

Disable building documentation and CLI tools

* Update CMakeLists.txt

Fix cmake script when using 3.8.0 and expecting imported targets to work when there are link flags included

* - use environment variables
- on ubuntu 18 gcc7, use ffmpeg 3.2.18

* correct way of dereferencing variables ?

* can't get variables to work

* Revert "can't get variables to work"

This reverts commit 5eef96a43e.

* Revert "correct way of dereferencing variables ?"

This reverts commit e8ff95f5c6.

* Revert "- use environment variables"

This reverts commit a6938333d5.

* using ffmpeg 3.2.18 with ubuntu18 gcc7

* Update build_cpp.yml

Disable ubuntu18 job for now. Hopefully no more cancelled jobs, then i can re-enable

* Re-enabled ubuntu18 job. Hopefully this time it won't get cancelled

* Fixed bad indentation

* Can go in details namespace

* Update dlib/CMakeLists.txt

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

* use details namespace

* remove declaration. It's in details now

* don't need get_channels_from_layout()

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Davis E. King <davis685@gmail.com>
2023-03-29 22:12:47 -04:00
Adrià Arrufat
4ffa9b02a5
Add simple polygon class (#2750)
* Add simple polygon class

* Add documentation for fill_convex_polygon

* Rename alpha_blend to antialias

* Update dlib/geometry/polygon_abstract.h

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

* Update dlib/geometry/polygon_abstract.h

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

* Update dlib/geometry/polygon_abstract.h

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

* Update dlib/geometry/polygon_abstract.h

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

* Update dlib/geometry/polygon_abstract.h

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

* Update dlib/geometry/polygon.h

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

* Update documentation for get_convex_shape

* Add tests for the polygon class

* Remove new line

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
2023-03-26 21:05:43 -04:00
Davis E. King
9a13229970
Exercise more of the ways dlib can be configured in the github actions tests (#2751) 2023-03-25 22:52:41 -04:00
Davis King
049c59d0f6 set correct cmake version in check 2023-03-25 15:56:54 -04:00
Davis E. King
53d2ceb669
test with cmake 3.8 since that's the min required cmake version for dlib (#2748)
* test with cmake 3.8 since that's the min required cmake version for dlib
2023-03-24 22:25:40 -04:00
Davis King
91dcb04055 fix ffmpeg cmake scripts not working with cmake 3.8 2023-03-23 23:44:43 -04:00
Erin
4d5db9940f
Fix crash when libX11 is missing locale support (#2747) 2023-03-23 21:45:30 -04:00
Davis King
806b629035 Make everything work in cmake 3.8 2023-03-23 20:07:48 -04:00
Davis King
b7834324b4 update sphinx config to work with newer versions of python 2023-03-22 22:11:20 -04:00
Davis King
15b2851318 improve docs 2023-03-22 22:02:30 -04:00
Davis King
32ab332989 cleanup docs 2023-03-18 08:28:13 -04:00
Lakshan Rukantha
9d305943bc
removed extra lines in the MANIFEST.in (#2744) 2023-03-17 08:08:18 -04:00
Adrià Arrufat
f89b0388d5
Add optional Python version (#2743) 2023-03-14 20:05:18 -04:00
Davis E. King
93aea6ea9b
Update bug.yml
Make the steps to reproduce required.
2023-03-12 10:13:18 -04:00
Adrià Arrufat
310a37f452
Improve issue template (#2741)
* Create but report template

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Update bug.yml

* Create feature request template

* Update feature.yml

* Update feature.yml

* Update feature.yml

* Remove ISSUE_TEMPLATE

* Create config.yml
2023-03-12 10:07:55 -04:00
cchadowitz-pf
3c0b3620af
Added bottom_up_cluster to python api (#2739)
* Added bottom_up_cluster to python api

* Update tools/python/src/face_recognition.cpp

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>

* Update tools/python/src/face_recognition.cpp

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>

---------

Co-authored-by: Davis E. King <davis685@gmail.com>
Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
2023-03-11 08:16:48 -05:00
Michal Suchánek
398e2cb5be
powerpc/altivec: use __vector instead of vector (#2740)
The gcc altivec extension defines keywords for vector, bool, and pixel,
both with underscores and without. However, unless another extension is
used the keywords without underscores conflict with standard types.

To resolve the conflict use the keywords with underscores for the
altivec vector types.

Fixes: #2711

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2023-03-11 08:16:15 -05:00
Davis King
257b81a172 update docs 2023-03-01 19:09:47 -05:00
smoosbau
ddad576d3e
fix wrong union calculation in box_overlap_testing.h (#2735)
Co-authored-by: Moosbauer, Sebastian <sebastian.moosbauer@posteo.de>
2023-03-01 19:08:26 -05:00
Adrià Arrufat
eb5de0d534
Add support for loading custom label fonts in imglab (#2733) 2023-02-23 22:34:06 -05:00
pfeatherstone
dc94754607
Fix for #2729 (#2731)
* fixes #2729

* don't commit vscode stuff

* Update ffmpeg_utils.h

typo

---------

Co-authored-by: pf <pf@me>
2023-02-20 20:01:13 -05:00
Adrià Arrufat
e006bfe5e8
Fix typo in input_layer documentation (#2725) 2023-02-10 22:04:22 -05:00
Adrià Arrufat
73a1c2f4fc
Fix unused variable warning in Pybind11 (#2726) 2023-02-10 22:03:47 -05:00
Adrià Arrufat
1958da78da
Rename ffmpeg examples (#2727) 2023-02-10 22:03:25 -05:00
Adrià Arrufat
4519a7a6bd
Add sum method to running stats (#2728) 2023-02-10 22:02:54 -05:00
pfeatherstone
50b33753bb
Strip binaries in release mode (#2721)
* - use add_executable directly
- use target_compile_definitions()
- strip binaries in release mode

* Added a comment

---------

Co-authored-by: pf <pf@me>
Co-authored-by: Davis E. King <davis685@gmail.com>
2023-02-03 17:43:00 -05:00
pfeatherstone
2138915dfe
added DLIB_USE_FFMPEG to config.h.in (#2720)
Co-authored-by: pf <pf@me>
2023-02-03 17:38:30 -05:00
pfeatherstone
9d3ba472dd
FFMPEG wrappers: dlib::ffmpeg::decoder and dlib::ffmpeg::demuxer (#2707)
* - added ffmpeg stuff to cmake

* - added observer_ptr

* ffmpeg utils

* WIP

* - added ffmpeg_decoder

* config file for test data

* another test file

* install ffmpeg

* added ffmpeg_demuxer

* install all ffmpeg libraries

* support older version of ffmpeg

* simplified loop

* - test converting to dlib object
- added docs
- support older ffmpeg

* added convert() overload

* added comment

* only register stuff when API not deprecated

* - fixed version issues
- fixed decoding

* added tests for ffmpeg_demuxer

* removed unused code

* test GIF

* added docs

* added audio test

* test for audio

* more tests

* review changes

* don't need observer_ptr

* made deps public. I could be wrong but just in case.

* - added some static asserts. Some areas of the code might do memcpy's on arrays of pixels. This requires the structures to be packed. Check this.
- added convert() functions
- changed default decoder options. By default, always decode to RGB and S16 audio
- added convenience constructor to demuxer

* - no longer need opencv

* oops. I let that slip

* - made a few functions public
- more precise requires clauses

* enhanced example

* - avoid FFMPEG_INITIALIZED being optimized away at link time
- added decoding example

* - avoid -Wunused-parameter error

* constexpr and noexcept correctness. This probably makes no difference to performance, BUT, it's what the core guidelines tell you to do. It does however demonstrate how complicated and unecessarily verbose C++ is becoming. Sigh, maybe one day i'll make the switch to something that doesn't make my eyes twitch.

* - simplified metadata structure

* hopefully more educational

* added another example

* ditto

* typo

* screen grab example

* whoops

* avoid -Wunused-parameter errors

* ditto

* - added methods to av_dict
- print the demuxer format options that were not used
- enhanced webcam_face_pose_ex.cpp so you can set webcam options

* if height and width are specified, attempt to set video_size in format_options. Otherwise set the bilinear resizer.

* updated docs

* once again, the ffmpeg APIs do a lot for you. It's a matter of knowing which APIs  to call.

* made header-only

* - some Werror thing

* don't use type_safe_union

* - templated sample type
- reverted deep copy of AVFrame for frame copy constructor

* - added is_pixel_type and is_pixel_check

* unit tests for pixel traits

* enhanced is_image_type type trait and added is_image_check

* added unit tests for is_image_type

* added pix_traits, improved convert() functions

* bug fix

* get rid of -Werror=unused-variable error

* added a type alias

* that's the last of the manual memcpys gone. We'using ffmpeg API everywhere now for copying frames to buffers and back

* missing doc

* set framerate for webcam

* list input devices

* oops. I was trying to make ffmpeg 5 happy but i've given up on ffmpeg v5 compatibility in this PR. Future PR.

* enhanced the information provided by list_input_devices and list_output_devices

* removed vscode settings.json file

* - added a type trait for checking whether a type is complete. This is useful for writing type traits that check other types have type trait specializations. But also other useful things. For example, std::unique_ptr uses something similar to this.

* Davis was keen to simply check pixel_traits is specialised. That's equivalent to checking pixel_traits<> is complete for some type

* code review

* juse use the void_t in dlib/type_traits.h

* one liners

* just need is_image_check

* more tests for is_image_type

* i think this is correct

* removed printf

* better docs

* Keep opencv out of it

* keep old face pose example, then add new one which uses dlib's ffmpeg wrappers

* revert

* revert

* better docs

* better docs

---------

Co-authored-by: pf <pf@me>
2023-01-29 20:17:34 -05:00
pfeatherstone
16a8a46a35
Fixed is_nothrow_swappable<> and simplified invoke-related type traits (#2716) 2023-01-29 13:13:00 -05:00
pfeatherstone
b9ac468169
Added bind_front() and bind_back() (#2705)
* Added bind_front()

* - Added bind_back()
- moved contents of invoke.h into functional.h
- invoke.h just includes functional.h
- added tests

* though it doesn't make a difference, use correct header

* add docs

* Give this a try. Might make gcc7 happy

* workaround for gcc7 bug

Co-authored-by: pf <pf@me>
Co-authored-by: Davis King <davis@dlib.net>
2023-01-04 07:38:36 -05:00
Davis E. King
1ce7b9cbc5
Run unit tests with gcc 7 too (#2706) 2023-01-03 10:13:54 -05:00
Davis King
a12824d425 update example to refer to newer dlib version 2022-12-15 22:15:18 -05:00
Julien Schueller
2ac3cdbad7
CMake: Make dependencies private (#2697)
* CMake: Private dependencies

Closes #2694

* Fix build error

Co-authored-by: Davis King <davis@dlib.net>
2022-12-15 22:13:19 -05:00
Davis King
f932f33b10 Fix incorrect xml blocks for leaky_relu and smelu 2022-12-09 08:10:25 -05:00
mattbn
2efc172c46
removed extra '<' in fc, added '\n' in layers/inputs/losses XML strings (#2698) 2022-12-09 08:08:11 -05:00
Adria Arrufat
02330e0a15
Fix GitHub actions on Windows because of CMake 3.25.0 (#2692) 2022-11-28 20:10:47 -05:00
Julien Schueller
01c7bfe880
Fix build on ppc64/mips64 (#2689) 2022-11-27 22:25:22 -05:00
Davis E. King
4d38ffa082
Suppress incorrect warning from gcc (#2691) 2022-11-27 22:23:29 -05:00
Michał Walenciak
136b2d9e5c
Reset last cuda error (#2685)
as error is handled here (exception is being thrown), we do not
want cudaGetLastError() to return any errors.
2022-11-12 12:57:38 -05:00
Davis King
05d3f6eb17 Disable mac os x python test config since something in the environment is not working properly. 2022-11-09 22:11:57 -05:00
Adria Arrufat
e5b2cedff8
Improve the data augmentation in the SSL example (#2684)
I was using the data augmentation recommended for the ImageNet dataset, which is not well suited
for CIFAR-10.
After doing so, the test accuracy increased by 1 point.
2022-11-09 22:07:00 -05:00
Davis King
3d5fb6fc7f Add an informative comment 2022-11-08 21:50:19 -05:00
Adria Arrufat
bdb1089ae6
Fix computation of the Barlow Twins loss gradient (#2680) 2022-11-02 07:55:58 -04:00