Commit Graph

561 Commits

Author SHA1 Message Date
Davis King
5d03b99a08 Changed to avoid compiler warning. 2019-03-03 20:12:43 -05:00
Juha Reunanen
f685cb4249 Add U-net style skip connections to the semantic-segmentation example (#1600)
* Add concat_prev layer, and U-net example for semantic segmentation

* Allow to supply mini-batch size as command-line parameter

* Decrease default mini-batch size from 30 to 24

* Resize t1, if needed

* Use DenseNet-style blocks instead of residual learning

* Increase default mini-batch size to 50

* Increase default mini-batch size from 50 to 60

* Resize even during the backward step, if needed

* Use resize_bilinear_gradient for the backward step

* Fix function call ambiguity problem

* Clear destination before adding gradient

* Works OK-ish

* Add more U-tags

* Tweak default mini-batch size

* Define a simpler network when using Microsoft Visual C++ compiler; clean up the DenseNet stuff (leaving it for a later PR)

* Decrease default mini-batch size from 24 to 23

* Define separate dnn filename for MSVC++ and not

* Add documentation for the resize_to_prev layer; move the implementation so that it comes after mult_prev

* Fix previous typo

* Minor formatting changes

* Reverse the ordering of levels

* Increase the learning-rate stopping criterion back to 1e-4 (was 1e-8)

* Use more U-tags even on Windows

* Minor formatting

* Latest MSVC 2017 builds fast, so there's no need to limit the depth any longer

* Tweak default mini-batch size again

* Even though latest MSVC can now build the extra layers, it does not mean we should add them!

* Fix naming
2019-01-06 09:11:39 -05:00
Juha Reunanen
cf5e25a95f Problem: integer overflow when calculating sizes (may happen e.g. with very large images) (#1148)
* Problem: integer overflow when calculating sizes (may happen e.g. with very large images)
Solution: change some types from (unsigned) long to size_t

# Conflicts:
#	dlib/dnn/tensor.h

* Fix the fact that std::numeric_limits<unsigned long>::max() isn't always the same number

* Revert serialization changes

* Review fix: use long long instead of size_t

* From long to long long all the way

* Change more types to (hopefully) make the compiler happy

* Change many more types to size_t

* Change even more types to size_t

* Minor type changes
2018-03-01 07:27:29 -05:00
Davis King
e6fe1e0259 merged 2017-12-25 08:51:15 -05:00
Davis King
c9faacce29 Fixed typos 2017-12-25 08:50:34 -05:00
Duc Thien Bui
9185e0a725 fix typo in train find cars example (#1028) 2017-12-25 07:56:42 -05:00
Davis King
efd945618d Minor update 2017-12-18 16:20:21 -05:00
Davis King
603ebc2750 Changed this example to use repeat layers. This doesn't change the behavior of
the code, but it helps visual studio use less RAM when building the example,
and might make appveyor not crash.  It's also a
slightly cleaner way to write the code anyway.
2017-12-17 14:41:00 -05:00
Davis King
22f26ebe97 Improved visual studio compilation instructions 2017-12-16 23:17:37 -05:00
Davis King
46a1893534 Fixed spelling error in comment 2017-12-11 06:40:00 -05:00
visionworkz
ac292309c1 Exposed jitter_image in Python and added an example (#980)
* Exposed jitter_image in Python and added an example

* Return Numpy array directly

* Require numpy during setup

* Added install of Numpy before builds

* Changed pip install for user only due to security issues.

* Removed malloc

* Made presence of Numpy during compile optional.

* Conflict

* Refactored get_face_chip/get_face_chips to use Numpy as well.
2017-12-08 09:59:27 -05:00
Davis King
e273f5159d Added find_min_global() overloads. 2017-12-02 07:53:31 -05:00
Davis King
15c04ab224 This example still uses a lot of visual studio ram. 2017-12-01 00:26:31 -05:00
Davis King
2b3d8609e5 These examples compile now in visual studio due to the recent pragma directive added to core.h. 2017-11-30 22:38:29 -05:00
Davis King
4fa32903a6 clarified docs 2017-11-25 19:28:53 -05:00
Davis King
4d0b203541 Just moved the try block to reduce the indentation level. 2017-11-25 12:25:35 -05:00
Davis King
929870d3ad Updated example to use C++11 style code and also to show the new find_max_global() routine. 2017-11-25 12:23:43 -05:00
Davis King
1aa6667481 Switched this example to use the svm C instead of nu trainer. 2017-11-25 08:26:16 -05:00
Davis King
04991b7da6 Made this example program use the new find_max_global() instead of grid search
and BOBYQA.  This greatly simplifies the example.
2017-11-24 22:04:25 -05:00
Amin Cheloh
1798e8877c Update dnn_mmod_find_cars2_ex.cpp (#966) 2017-11-17 06:38:48 -05:00
Davis King
b84e2123d1 Changed network filename to something more descriptive. 2017-11-15 07:10:50 -05:00
Juha Reunanen
e48125c2a2 Add semantic segmentation example (#943)
* Add example of semantic segmentation using the PASCAL VOC2012 dataset

* Add note about Debug Information Format when using MSVC

* Make the upsampling layers residual as well

* Fix declaration order

* Use a wider net

* trainer.set_iterations_without_progress_threshold(5000); // (was 20000)

* Add residual_up

* Process entire directories of images (just easier to use)

* Simplify network structure so that builds finish even on Visual Studio (faster, or at all)

* Remove the training example from CMakeLists, because it's too much for the 32-bit MSVC++ compiler to handle

* Remove the probably-now-unnecessary set_dnn_prefer_smallest_algorithms call

* Review fix: remove the batch normalization layer from right before the loss

* Review fix: point out that only the Visual C++ compiler has problems.
Also expand the instructions how to run MSBuild.exe to circumvent the problems.

* Review fix: use dlib::match_endings

* Review fix: use dlib::join_rows. Also add some comments, and instructions where to download the pre-trained net from.

* Review fix: make formatting comply with dlib style conventions.

* Review fix: output training parameters.

* Review fix: remove #ifndef __INTELLISENSE__

* Review fix: use std::string instead of char*

* Review fix: update interpolation_abstract.h to say that extract_image_chips can now take the interpolation method as a parameter

* Fix whitespace formatting

* Add more comments

* Fix finding image files for inference

* Resize inference test output to the size of the input; add clarifying remarks

* Resize net output even in calculate_accuracy

* After all crop the net output instead of resizing it by interpolation

* For clarity, add an empty line in the console output
2017-11-15 07:01:52 -05:00
Davis King
978da26ed0 Fixed grammar in comment 2017-11-05 07:37:29 -05:00
Davis King
50de3da992 Updated comments to reflect recent API changes. 2017-11-02 05:43:15 -04:00
Davis King
dc0245af05 Changed graph construction for chinese_whispers() so that each face is always
included in the edge graph.  If it isn't then the output labels from
chinese_whispers would be missing faces in this degenerate case.
2017-10-27 19:29:52 -04:00
Davis King
e338bf02e0 Changed the random_cropper's set_min_object_size() routine to take min box
dimensions in the same format as the mmod_options object (i.e. two lengths
measured in pixels).  This should make defining random_cropping strategies that
are consistent with MMOD settings much more straightforward since you can just
take the mmod_options settings and give them to the random_cropper and it will
do the right thing.
2017-10-24 22:10:02 -04:00
Davis King
1c664eeac5 Made the metric learning example do image jittering. 2017-10-24 21:13:02 -04:00
Davis King
369f2b32e8 Cleaned up jitter_image() code and moved it into dlib proper. 2017-10-24 08:02:44 -04:00
Davis King
525bf0e15b Fixed weird wording. 2017-10-17 19:20:29 -04:00
Davis King
3aa9991892 Made comment more clear. 2017-10-17 19:18:57 -04:00
Davis King
3b2d73db68 Some cmake script cleanup and refactoring. 2017-10-16 20:55:28 -04:00
Davis King
d39b843de0 Added another car finding example 2017-09-16 15:35:58 -04:00
Davis King
4737009c11 Clarified comments 2017-09-16 15:35:37 -04:00
Davis King
8bfd227930 Changed to slightly better default recommendations for parameters. 2017-09-16 15:14:13 -04:00
Davis King
b4bd6f8dee More cleanup 2017-09-16 14:10:09 -04:00
Davis King
57b6cd1b80 clarified error message 2017-09-16 14:01:34 -04:00
Davis King
37e0b9ea68 Updated comments. 2017-09-15 22:16:00 -04:00
Davis King
41c2f217c6 Changed code to recommend users use the new 5 point face landmarking model. 2017-09-15 19:58:27 -04:00
Davis King
4fcc5faa39 Fixed grammar 2017-09-15 19:57:16 -04:00
Davis King
8de1a1ed6a Improved citations 2017-09-10 22:22:55 -04:00
Davis King
71db541a92 Minor cleanup 2017-08-27 18:18:00 -04:00
Davis King
3211da440d Yet more comments 2017-08-27 12:01:24 -04:00
Davis King
a362305e1b cleanup 2017-08-27 10:46:49 -04:00
Davis King
5e9f094d5a Fixed compiler warning 2017-08-27 09:23:57 -04:00
Davis King
88c1bf3b46 Added youtube links 2017-08-27 09:17:05 -04:00
Davis King
efb1d83dd3 More comments 2017-08-27 09:11:49 -04:00
Davis King
54de7a8546 Added more comments 2017-08-27 08:29:36 -04:00
Davis King
aec695fc26 Cleanup 2017-08-27 07:31:50 -04:00
Davis King
51eae2ba07 Added two vehicle detection examples. 2017-08-26 17:13:47 -04:00
Davis King
420eba0e6a Added note about logging training parameters. 2017-08-06 11:34:07 -04:00