dlib C++ Library: 20.0 Released
I diligently followed every step outlined in the documentation, just as I've done with older versions of dlib without encountering any issues with this link
That was also my guess. It is happening already on the first few function evaluations. Thank you.
Na that shouldn't be happening. You should see each dimension changing in value unless it's been running long enough to figure out that those are the only legit values. That would also though require the bounds you set to be tight enough to bottle it up into that area. Or there is just a bug in your code. On Sat, Jan 27, 2024 at 2:29 PM Balázs Bámer kolaloka@users.sourceforge.net wrote: Hi All, I have a problem using find_max_global. I'm using a search space with a dimension of 9, and as the optimizer...
Hi All, I have a problem using find_max_global. I'm using a search space with a dimension of 9, and as the optimizer is exploring the search space, the last 4 dimension values are always the same. Can this be normal? Thank you in advance. Best regards: Balazs
Aside from making sure compiler optimizations are on, use smaller images. See also http://dlib.net/faq.html#Whyisdlibslow On Thu, Nov 16, 2023 at 6:33 AM Nikhil B bwajster@users.sourceforge.net wrote: The code below only runs at 1-2FPS. Need help making the necessary changes to improve the frame rate to about 10fps. The code is implemented on the jetson nano. ~~~ import face_recognition import cv2 import os import dlib import pickle import time print(cv2.version) fpsReport=0 scaleFactor=.25 Encodings=[]...
The code below only runs at 1-2FPS. Need help making the necessary changes to improve the frame rate to about 10fps. The code is implemented on the jetson nano. import face_recognition import cv2 import os import dlib import pickle import time print(cv2.__version__) fpsReport=0 scaleFactor=.25 Encodings=[] Names=[] with open('train.pkl','rb') as f: Names=pickle.load(f) Encodings=pickle.load(f) font=cv2.FONT_HERSHEY_SIMPLEX cam=cv2.VideoCapture(0) timeStamp=time.time() while True: _,frame=cam.read()...
Successfully built DLib-19.24 with C++11, but failed with C++14, and C++17 also failed.
Guten Tag, Ich versuche gerade ein Programm für 3D Gesicht Modellierung zu erstellen. Für die Enplementierung in C++ verwende ich Dlib. Da es sich um ein PRnet Programm habe ich das Problem, dass ich keine Prnet Quelle in der Dlib Bibliothek finde. Ich habe in Internet folgende Quelle gefunden: include <dlib image_processing="" prnet.h=""></dlib> aber dies wird von der Bibliothek nicht erkannt. Haben Sie vielleicht eine Ahnung wie ich hier vorgehen kann? Viele Grüße Arsene
Known_users
I just tried a bunch of values and found some that worked :) On Fri, Aug 5, 2022 at 1:14 AM John Puskin johnpuskin@users.sourceforge.net wrote: Hi Davis. I wonder how do you determine distance as 0.6, margin as 0.04 and dimension as 128 in face recognition? What do you think about for dimension 32, setting distance as 0.3 and margin as 0.02? Thank you for your valuable dlib library. About Margin, Distance and Dimension of Face Recognition Sent from sourceforge.net because you indicated interest in...
Hi Davis. I wonder how do you determine distance as 0.6, margin as 0.04 and dimension as 128 in face recognition? What do you think about for dimension 32, setting distance as 0.3 and margin as 0.02? Thank you for your valuable dlib library.
dlib C++ Library: 19.24 Released
http://dlib.net/faq.html#HowdoIsetthesizeofamatrixatruntime On Fri, Feb 4, 2022 at 2:35 AM "Kovács János" kovatsjanos@users.sourceforge.net wrote: Hello! I'm stucked with my work. I'm new to dlib. My questions concern (Q1.) the usage of dlib datastructures. My task is to perform spectral_clustering. I studied: http://dlib.net/kkmeans_ex.cpp.html. (Q2.) I have to separate training from the classification. Question 1 1 //In MyClass.cpp 2 void doTrain(size_t pClusterN, size_t pNR, size_t pNC, float...
See http://dlib.net/faq.html#HowdoIsetthesizeofamatrixatruntime
Hello! I'm stucked with my work. I'm new to dlib. My questions concern (Q1.) the usage of dlib datastructures. My task is to perform spectral_clustering. I studied: http://dlib.net/kkmeans_ex.cpp.html. (Q2.) I have to separate training from the classification. Question 1 1 //In MyClass.cpp 2 void doTrain(size_t pClusterN, size_t pNR, size_t pNC, float pData) 3 { 4 //pData is a matrix flattened to a single row. pData is of pNRxpNC length. 5 6 using sampletype = matrix<float, ?,="" ?="">; // 1row x...
dlib C++ Library: 19.23 Released
Hi Mr. Davis. I trained three separate detectors based on your example : http://dlib.net/dnn_mmod_train_find_cars_ex.cpp.html As a result I got three ".dat" files, Each detect one type of object. front.dat , rear.dat , side.dat Is it possibile to "merge" those 3 files and load into "dnn_mmod_find_cars2_ex.cpp" example ? thank you
Yeah find_min_box_constrained is what you want. On Mon, Nov 22, 2021 at 12:43 PM Gordon N. gordonn@users.sourceforge.net wrote: I have a non linear equation with one free parameter to solve. Is there a possibility in dlib to set a constraint on that parameter because the equation contains some logarithms and must not be smaller or equal to zero. My first guess is to use dlib::find_min_box_constrained with a lbfgs_search_strategy where the functional is the squared difference from the target result....
I have a non linear equation with one free parameter to solve. Is there a possibility in dlib to set a constraint on that parameter because the equation contains some logarithms and must not be smaller or equal to zero. My first guess is to use dlib::find_min_box_constrained with a lbfgs_search_strategy where the functional is the squared difference from the target result.
Thanx for your answer. If you consider adding integer quantization or even if float16 support to dlib DNN modules, it will give us superior performance. Otherwise, becuase of speed requirements, even I hate, I have to use "pseudo-open source" python based DNN platforms.
No, it's all 32bit everywhere right now.
As far as I know, dlib dnn model weights employ float-32 bits and there is no ready-to-use dnn model weight quantization C++ code. However, I think that if we use float-16, we make inference faster. Is there an easy way to force dlib dnn models to use 16-bit floating numbers?
Yeah, that's all correct. There are lots of ways to do it, simplest is probably what you suggested of using imglab to just prerotate by a big value. On Thu, May 27, 2021 at 4:16 AM John Puskin johnpuskin@users.sourceforge.net wrote: mmod automatically determines the detector window's sizes by analyzing the dataset without considering the cropper rotation angle. However if I set cropper rotation angle a high value, (e.g. cropper.set_max_rotation_degrees(90) ) dataset will dramatically change and previous...
mmod automatically determines the detector window's sizes by analyzing the dataset without considering the cropper rotation angle. However if I set cropper rotation angle a high value, (e.g. cropper.set_max_rotation_degrees(90) ) dataset will dramatically change and previous "detector window's sizes" might not suffice. Do I miss something? How can I handle highly rotated and cropped dataset? Rather than setting a high value for cropper angle, should I manually rotate the dataset? (e.g. "imglab --rotate...
It really depends. It's fundamentally easier to train separate models most of the time since you can tweak and adjust them separately. E.g. you can adjust detector A without any possibility of messing up detector B. At the same time, if you put some effort in you can usually make one single model that does multiple things at much less overall computational cost. On Mon, May 24, 2021 at 3:29 AM John Puskin johnpuskin@users.sourceforge.net wrote: Hi Davis. Which one is the best strategy for multi-object...
Hi Davis. Which one is the best strategy for multiclass-object detection? 1. Train separate classifier for each object type 2. Train one classifier with different labels as in "dnn_mmod_find_cars2_ex.cpp"
Hi Davis. Which one is the best strategy for multi-object detection? 1. Train separate classifier for each object 2. Train one classifier with different labels as in "dnn_mmod_find_cars2_ex.cpp"
I got accuracy > 90% . Thanx a lot.
Try training a linear SVM on top of it and see if it works. Might be ok.
Dear Davis, I plan to use your 128 dimensional face recognition representation for beard detection. Any suggestion?
dlib C++ Library: 19.22 Released
For Windows 7. and above; 1. How can I set resizable=False for image_window? 2. How can I set an instance of "image_window "always on top" ?
Hi. I compiled Opencv as defined in https://learnopencv.com/install-opencv-4-on-windows/ Shortly: related Cmake rows for OpenCV shown below. cmake -G "Visual Studio 16 2019" -T host=x64 -DBUILD_SHARED_LIBS=OFF [... other stuff] cmake.exe --build . --config Release --target INSTALL Up to now, everything is alright but when considering dlib, I don't compile dlib's webcam_face_pose_ex.cpp. I got the following errors shown below. Would you please help me? error LNK2038: mismatch detected for 'RuntimeLibrary':...
Hi. I compiled Opencv as defined in https://learnopencv.com/install-opencv-4-on-windows/ Shortly: related Cmake rows for OpenCV shown below. 1. cmake -G "Visual Studio 16 2019" -T host=x64 -DBUILD_SHARED_LIBS=OFF [... other stuff] 4. cmake.exe --build . --config Release --target INSTALL Up to now, everything is alright but when considering dlib, I don't compile dlib's webcam_face_pose_ex.cpp. I got the following errors shown below. Would you please help me? error LNK2038: mismatch detected for 'RuntimeLibrary':...
Hi. I compiled Opencv as defined in https://learnopencv.com/install-opencv-4-on-windows/ Shortly: related Cmake rows for OpenCV shown below. 1. cmake -G "Visual Studio 16 2019" -T host=x64 -DBUILD_SHARED_LIBS=OFF [... your stuff] 2. cmake.exe --build . --config Release --target INSTALL Up to now, everything is alright but when considering dlib, I don't compile dlib's webcam_face_pose_ex.cpp. I got the following errors shown below. Would you please help me? error LNK2038: mismatch detected for 'RuntimeLibrary':...
Hi Davis, I have used the PInvoke method , and i wanted to get the image_window to be accessed in the c# project or is there any way to get all the data related to ( std::vector<dlib::rectangle> dets = detector(img); std::vector<full_object_detection> shapes; ) to c# project?</full_object_detection></dlib::rectangle>
Alternative of Image_window in dlib?
Hey Davis, I am getting the error,. I have used openCV and it's working fine, but when ever I am using the dlib in my header file and getting same error as Note : I am using CLR instead of swig to connect c# and c++ project. ": <conditionvariable>, <future>, <mutex> and <thread> not being supported in /clr or /clr:pure."</thread></mutex></future></conditionvariable> Can you please suggest some way to get rid of these errors :) @davisking
Hey Davis, Even I am getting the same error,. I have used openCV and it's working fine, but when ever I am using the dlib in my header file and getting same error as mentioned by Dane : "about <conditionvariable>, <future>, <mutex> and <thread> not being supported in /clr or /clr:pure."</thread></mutex></future></conditionvariable> Can you please suggest some way to get rid of these errors :) @davisking
Thanks Davis, I will have a look at krr.
You should give one of the regression methods in dlib a try before rolling your own solution. http://dlib.net/ml.html#krr_trainer is a good general method for this kind of thing.
Hi Davis, I was experimenting with trying to fit a piecewise function with solve_least_squares where I am looking for both coefficients of the line and the changepoint itself. The code below is modified from your example. #include <dlib/optimization.h> #include <vector> #include <iostream> #include <array> typedef dlib::matrix<double, 1,1> InputVector ; typedef dlib::matrix<double, 3,1> ParameterVector; // an example changepoint function with a breakpoint in a single dimension double model (const...
OK. I see it now: this_layer_setup_called is being tracked and used to call setup if needed. So it looks like copying the layer details doesn't copy everything for the layer. But at least I've got an easy work around for now. Thanks, Dave
This is expected. The first time you run a network it will call the .setup() function on each layer. Although if you copied the whole layer state you would copy over the flag that says setup was already run. But if you copy only some subset of a layer's state, like only the parameter tensor, then this is an expected outcome. On Mon, Nov 16, 2020 at 5:35 PM Dave dremerso@users.sourceforge.net wrote: Davis, I've noticed an odd behavior after copying network weights from one network to another. This...
Davis, I've noticed an odd behavior after copying network weights from one network to another. This might just be my own ignorance on how the network is working when data first runs through a network. Here's what I'm doing: I'm playing around with a simple autoencoder and I want to separate the original network into its encoder/decoder set and work with each half independently Original Net: layer<0> loss_mean_squared_multioutput layer<1> fc (num_outputs=2048) learning_rate_mult=1 weight_decay_mult=1...
I would like to do online continuous training, and not to do retraining on the whole dataset each time a little more data arrives. I am coding in c++. I need random forest regression. conceptually similar to: rf = RandomForestClassifier(n_estimators=500, criterion='entropy', random_state=42) //new data arives rf.fit(X_train, y_train) rf.predict(X_input) //new data arives rf.fit(X_train, y_train) rf.predict(X_input) ... here is a sample code #include <fstream> #include <string> #include <vector> #include...
I followed the default build method for examples.(c++ programs). When I run dnn_face_recognition_ex faces/bald_guys.jpg, I see the faces are all blue. I don't know why this is happening. I know open-cv uses bgr color format (if we open it with opencv, but why is there this color problem when the given example uses only dlib/image_io? I guess this is happening only to me. I this this doesn't matter but I used this build method(from examples directory). mkdir build cd build cmake .. -DDLIB_USE_CUDA=1...
I have solved, if anyone has the same problem, just write me here.
I generated with CMake a VS2017 solution for dlib example: D:\Project\dlib-19.21\examples\dlib_build I have generated the solution with following settings: Visual Studio 2017 (v141), Windows SDK Version 10.0.17134.0 See attached image. Generated solution file, with a note, I didn't installed OpenCV. And when I compiled the examples.sln file, I got two errors: 1>------ Build started: Project: dnn_imagenet_train_ex, Configuration: Debug x64 ------ 2>------ Build started: Project: dnn_semantic_segmentation_train_ex,...
I generated with CMake a VS2017 solution for dlib example: D:\Project\dlib-19.21\examples\dlib_build I have generated the solution with following settings: Visual Studio 15 2017, playtform x64, no arguments. See attached image. Generated solution file, with a note, I didn't installed OpenCV. And when I compiled the examples.sln file, I got two errors: 1>------ Build started: Project: dnn_imagenet_train_ex, Configuration: Debug x64 ------ 2>------ Build started: Project: dnn_semantic_segmentation_train_ex,...
Thanks for the reply. What you suggest sounds reasonable. I shall try that.
You can call sum_rows(m)/m.nr() If you want to run a column wize function on a matrix I think the simplest and most reasonable way is to just write a for loop. A function that applied a lambda would just be a function with a for loop that called the lambda. On Wed, Aug 12, 2020 at 7:34 AM Matt Daley mbdaley@users.sourceforge.net wrote: Hello, bit of a newbie here I'm afraid! I have a matrix. I want to calculate the mean of each column and place these values into a vector. Is there a standard, simple...
Hello, bit of a newbie here I'm afraid! I have a matrix. I want to calculate the mean of each column and place these values into a vector. Is there a standard, simple way to do this? In fact, is there a way, generally, to run a function column-wise on a matrix? For example using Eigen I can calculate the mean of each column of MatrixXd m using this: VectorXd means = m.colwise().mean(); Also, mean() can be replaced by other functions that operate on a vector and return a single value. I'd love there...
dlib C++ Library: 19.21 Released
It's ok so long as your network has the capacity and resolution to localize things that small. For instance, if the stride of the final layer is 40 pixels then it's definitely not going to be able to work, as it simply won't be able to place boxes on many possible locations. So long as you make the stride small enough (e.g. by not doing too much max pooling or other downsampling, or by upsampling appropriately) you will be fine.
Hi Davis, dnn_mmod_ex.cpp and underlying theory is a wonderful tool and it really works. I want to ask some details. All my training &testing sample boxes' widht&height>120 but I want to detect smaller object with size 40x40. Thus I set mmod_options options(boxes_train, 40, 40); and cropper.set_min_object_size(40,40); , cropper.set_chip_dims(300, 300); Is it Ok? How the training box size is related to mmod_options? What is the ideal size of mmod_options & cropper.set_mins in regarding with training...
Hi Davis, dnn_mmod_ex.cpp and underlying theory is a wonderful tool and it really works. I want to ask some details. All my training &testing sample boxes' widht&height>120 but I want to detect smaller object with size 40x40. Thus I set mmod_options options(boxes_train, 40, 40); and cropper.set_min_object_size(40,40); , cropper.set_chip_dims(300, 300); Is it Ok? How the training box size is related to mmod_options? What is the ideal size of mmod_options & cropper.set_mins in comparing with training...
Hi Davis, dnn_mmod_ex.cpp and underlying theory is a wonderful tool and it really works. I want to ask some details. All my training &testing sample boxes' widht&height>120 but I want to detect smaller object with size 40x40. Thus I set mmod_options options(boxes_train, 40, 40); and cropper.set_min_object_size(40,40); , cropper.set_chip_dims(300, 300); Is it Ok?
Hi all, I am trying to train a custom object detector to detect small icons in images. I am getting the impossible boxes error. (dl4cv) pranav@machinelearning:~/networkArchitectureReader$ python train_detector.py -x networkIcons.xml --detector ./icons.svm [INFO] training detector... Training with C: 1 Training with epsilon: 0.01 Training using 4 threads. Training with sliding window 82 pixels wide by 78 pixels tall. Upsample images... Upsample images... Traceback (most recent call last): File "train_detector.py",...
Hi all, I need to train a custom object detector to detect a number of small icons in an image. When I run the training session, I get the following error. RuntimeError: Error! An impossible set of object boxes was given for training. All the boxes need to have a similar aspect ratio and also not be smaller than about 400 pixels in area. The following images contain invalid boxes: When dlib says 400 pixels, does it mean in length or width? Should I make everything 400 by 400 pixels? See the below...
Yeah you should switch to affine layers when you are going to use it for real. But in that particular example, it feeds only one image at a time to the network. The bn_con layer automatically runs in affine mode when given just one element at a time.
Dear Davis, In dnn_mmod_ex.cpp "bn_con" layers are used in both training & testing (at the end of training). In testing, "affine" layers must be used instead of bn_con layer. Am I missing something? Best regards.
Right, there is no pretrained model in dlib for this. You could use instance segmentation or a vanilla mmod detector or something like that to do it though. There are always performance and accuracy tradeoffs. Making a high quality training dataset is also non-trivial and where you should spend most of your time. I would look at some CVPR papers that talk about detecting pedestrians or humans if you want more ideas. On Fri, Jun 12, 2020 at 6:32 PM John Puskin johnpuskin@users.sourceforge.net wrote:...
Dear Davis, I want to detect the humans in the given images. As far as I know, there is no pretrained model for human detection & localization in the dlib. Face detection models only work with faces, they don't detect humans whose face cannot be seen. However, I think, maybe I can use "instance segmentation" (http://dlib.net/files/instance_segmentation_voc2012net_v2.dnn) model for human/people detection. (instance.rect maybe what I am needed). Is it possible? Do you suggest it? Is there any performance...
dlib C++ Library: 19.20 Released
Nevermind, I was able to use the overloaded function with image_scale.
How can use resize_image if I don't know the x and y dimensions while declaring the variable. Similar to the snippet posted above, if I am programatically determining "640" and "480", is there an overloaded method for resize that will take these values as parameters? I looked through the documentation but could not find anything similar to this.
Hello, In C++ we use dlib::serialize(path) >> model But how to free the memory of the model ? Thank you, Christophe
That works. Thanks!
Dlib is still just as header only as it always has been. However, I added that dlib/test_for_odr_violations.h file because I constantly get questions from people who were doing silly things with their builds, getting errors that have nothing to do with dlib, and asking me about it. If you blank out the contents of dlib/test_for_odr_violations.h it will all be header only again.
Well, I shouldn't say "all". Dlib has never been all header only. But it should work like you expect.
I am upgrading an old project from dlib version 18.18. At that time dlib was a header-only library, so I only needed to add dlib to my include path and I was all set. My project is built using visual studio (originally 2015, now 2019). Newer dlib versions require compiling dlib. I got things to work with version 19.19 by adding all/source.cpp to my visual studio project and making some modifications to get around errors (adding /bigobj to the compile options and dealing with precompiled headers)....
Thanks so much! I'll give it a shot and let you know what I get.
Start by annotating 100 faces, or 200 maybe. Train a model using that data and see what you get. Then use that model to label a bunch of other images and go manually move the landmarks to the right places. Then retrain and relabel. Repeat a few times as your grow your dataset.
I'm trying to use dlib's imglab tool to annotate my own facial landmark dataset to include points for the hairline, pupils, neck, and ears similar to the markup I've attached below. I'm a little apprehensive about getting started though because I'm unsure how precise the points have to be as some of the images from the databases I am working with don't have a single person looking directly into the camera. Do you have any tips for me? I feel like once I get started, things will quickly get out of...
I'm trying to use dlib's imglab tool to annotate my own facial landmark dataset to include points for the hairline, pupils, neck, and ears similar to the markup I've attached below. I'm a little apprehensive about getting started though because I'm unsure how precise the points have to be as some of the images from the databases I am working with don't have a single person looking directly into the camera. Has anyone already tried doing this and do you have any tips for me? I feel like once I get...
One layer does batch norm and another just linearly transforms the outputs. The latter is not useful since you will be stacking adjacent to some other linear transformation like a convolution, and two linear things combine into another linear thing, so no additional modeling capacity is gained.
@davisking What's the difference between bn_con and affine layers? Why doesn't using affine layers in training make sense mathematically?
They save an object's state to a stream.
I am trying to modify the dlib random forest regression code to use features derived from patches in training images. What is the role of various serialization, deserialization functions in the various classes in random_forest_regression_abstract.h. I do not know the use of serialization/deserialization in image processing context(or otherwise). Kindly help.
Thank you, it looks its working. I made 150x150 images, sort it to folders and train it with dnn_metric_learning_on_images_ex. It is doing clustering how i would expect with dnn_face_recognition_ex, but I have last question. I decide that I want more groups, not just binary classificator. Is there information in that trained .dat file about the folders names? And maybe set it instead of "face cluster 0" to title of window? I know it's set with "win_clusters[cluster_id].set_title("face cluster " +...