dlib 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28f85b804791454aa5a9e9f4bc8573f8af0c9da6
4
- data.tar.gz: 0be4a7dfa32c83ea73640b483a2b0ecc5c45674c
3
+ metadata.gz: cbeddf3b261446f42826e5292e042b73b49e19aa
4
+ data.tar.gz: 8faff841b4796da8ae2542205e38f1861790952b
5
5
  SHA512:
6
- metadata.gz: ce89bc27b7cf2b1e3cc3f94f0bbe37dddec6c99527d27dca67bb9bd5709340885838419f8d6e5bae100774e067ab453040ef966e5a2d7cb0dbd9500f1e8cbff6
7
- data.tar.gz: 8dfa3750b3eef607aadfba745a6e8053864f10ce84563f47b3ff05ebd2bf2961875ec9e67fc374f061ca2ccc7990a6d7866dd35fdf49fc5188f8ab4d78ef9aec
6
+ metadata.gz: 842641f113e980beac12e81c0dcee7d4335d85d1c0cdedc4d81a7f4bc05ffea32d50fba260df035e4545f5efd80dd5ee3923b73cec909d2b78e32cbc0cd75e16
7
+ data.tar.gz: 9aa7a42e527329be811591f955d632c5f1e533f5b139815603f2d61f7776aea9c6526af52df5c5414952137dfc6a98c5f0f4c3e52bd3ae91433efdcd53147174
data/Changes.md CHANGED
@@ -3,6 +3,12 @@
3
3
  At first, you can see original Release notes.
4
4
  http://dlib.net/release_notes.html
5
5
 
6
+ ## 1.1.5 (use dlib 19.4)
7
+
8
+ ### Bug fixes
9
+
10
+ * Make GPU memory management better with ruby's GC
11
+
6
12
  ## 1.1.4 (use dlib 19.4)
7
13
 
8
14
  ### Bug fixes
@@ -27,6 +27,7 @@ static void
27
27
  dnn_fd_container_free(void *ptr)
28
28
  {
29
29
  dnn_fd_container *dnn_fdcont = static_cast<dnn_fd_container *>(ptr);
30
+
30
31
  delete dnn_fdcont;
31
32
  }
32
33
 
@@ -100,8 +101,10 @@ dlib_rb_dnn_fd_detect_in_batches(VALUE dnn_fd, VALUE images)
100
101
  try {
101
102
  detections_in_batches = dnn_fdcont->net(matrixes);
102
103
  } catch (dlib::cuda_error& error) {
104
+ dnn_fdcont->net.clean();
103
105
  rb_raise(eDlibCudaError, "cuda error during inferencing: %s", error.info.c_str());
104
106
  } catch (std::bad_alloc& error) {
107
+ dnn_fdcont->net.clean();
105
108
  rb_raise(rb_eNoMemError, "bad allocation memory during inferencing");
106
109
  }
107
110
 
@@ -112,7 +115,20 @@ dlib_rb_dnn_fd_detect_in_batches(VALUE dnn_fd, VALUE images)
112
115
  rb_ary_push(result, dlib_rb_rectangle_new(detection.rect));
113
116
  }
114
117
  rb_ary_push(result_all, result);
118
+
119
+ // force free memory on GPU
120
+ detections.clear();
121
+ detections.shrink_to_fit();
115
122
  }
123
+ // force free memory on GPU
124
+ detections_in_batches.clear();
125
+ detections_in_batches.shrink_to_fit();
126
+
127
+ matrixes.clear();
128
+ matrixes.shrink_to_fit();
129
+
130
+ dnn_fdcont->net.clean();
131
+
116
132
  return result_all;
117
133
  }
118
134
 
@@ -1,3 +1,3 @@
1
1
  module Dlib
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-31 00:00:00.000000000 Z
12
+ date: 2017-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler