Lerobot-Dataset-Ruby 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +7 -9
- data/lib/Lerobot/Dataset/Ruby/writer.rb +8 -15
- data/lib/Lerobot/Dataset/Ruby.rb +8 -1
- data/lib/lerobot-dataset-ruby.rb +3 -0
- data/lib/lerobot.rb +3 -0
- data/test/minimal_lerobot_check.rb +1 -2
- data/test/sample.rb +1 -2
- metadata +3 -2
- data/lib/Lerobot/Dataset/Ruby/version.rb +0 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46b187339341ea39b9482e55744dd2bc61b6ea5fe66c40ecd2fce3862781cb76
|
|
4
|
+
data.tar.gz: e8de384c72390d6a2aa1a65629967b6eadb6aa049351b34d864c48bc6dda37f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd625cb1018498777126c4a68e9c5c8cec29cc823dbcefe7dfbae3de42f9ff37577cccb83a7830b6bbed1eb530ce6deef8d76ad11151a1026b01995d56b1d5b9
|
|
7
|
+
data.tar.gz: c1003fa30554f991b832b78897e4a1ccf97854e23dadbf7ea10a4de640d798c48906c46fba65c108bd8936418fc9f481c8946e3ea0b77b346d924ddd9a7be385
|
data/Rakefile
CHANGED
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
require "bundler/gem_tasks"
|
|
4
4
|
require "rake/testtask"
|
|
5
5
|
|
|
6
|
-
desc "Compile
|
|
6
|
+
desc "Compile C++ extension"
|
|
7
7
|
task :compile do
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
system("
|
|
8
|
+
Dir.chdir("ext/opencv") do
|
|
9
|
+
system("ruby extconf.rb", exception: true) unless File.exist?("Makefile")
|
|
10
|
+
system("make", exception: true)
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
Rake::TestTask.new(:test) do |t|
|
|
15
|
-
t.libs << "test"
|
|
16
|
-
t.libs << "lib"
|
|
14
|
+
Rake::TestTask.new(:test => :compile) do |t|
|
|
15
|
+
t.libs << "test" << "lib"
|
|
17
16
|
t.test_files = FileList["test/test_*.rb"]
|
|
18
17
|
end
|
|
19
18
|
|
|
20
|
-
task
|
|
21
|
-
task default: :test
|
|
19
|
+
task default: :test
|
|
@@ -31,11 +31,6 @@ module Lerobot
|
|
|
31
31
|
|
|
32
32
|
# 録画開始(内部でLibopencvを呼び出す)
|
|
33
33
|
def start_recording(path = nil, fps = nil)
|
|
34
|
-
begin
|
|
35
|
-
require 'libopencv'
|
|
36
|
-
rescue LoadError
|
|
37
|
-
require_relative '../../../../ext/opencv/libopencv'
|
|
38
|
-
end
|
|
39
34
|
path ||= File.join(@output_dir, 'videos', 'rgb', 'chunk-000', 'file-000.mp4')
|
|
40
35
|
Libopencv.start_recording(path, fps || @fps)
|
|
41
36
|
image_bytes = Libopencv.take_picture
|
|
@@ -161,17 +156,15 @@ module Lerobot
|
|
|
161
156
|
video_path = File.join(video_dir, 'file-000.mp4')
|
|
162
157
|
FileUtils.mkdir_p(video_dir)
|
|
163
158
|
|
|
164
|
-
|
|
165
|
-
File.expand_path('../../../../test/test.mp4', __dir__),
|
|
166
|
-
File.expand_path('../../../../public/test.mp4', __dir__),
|
|
167
|
-
File.join(__dir__, 'test', 'test.mp4'),
|
|
168
|
-
File.join(__dir__, 'public', 'test.mp4')
|
|
169
|
-
]
|
|
170
|
-
sample_path = sample_candidates.find { |path| File.exist?(path) }
|
|
159
|
+
return video_path if File.exist?(video_path)
|
|
171
160
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
161
|
+
gem_root = File.expand_path('../../../..', __dir__)
|
|
162
|
+
sample_path = [
|
|
163
|
+
File.join(gem_root, 'test', 'test.mp4'),
|
|
164
|
+
File.join(gem_root, 'public', 'test.mp4')
|
|
165
|
+
].find { |path| File.exist?(path) }
|
|
166
|
+
|
|
167
|
+
FileUtils.cp(sample_path, video_path) if sample_path
|
|
175
168
|
video_path
|
|
176
169
|
end
|
|
177
170
|
|
data/lib/Lerobot/Dataset/Ruby.rb
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
begin
|
|
4
|
+
require "libopencv"
|
|
5
|
+
rescue LoadError
|
|
6
|
+
ext_so = File.expand_path("../../../ext/opencv/libopencv", __dir__)
|
|
7
|
+
require ext_so if File.exist?("#{ext_so}.so")
|
|
8
|
+
end
|
|
9
|
+
|
|
4
10
|
require_relative "Ruby/reader"
|
|
5
11
|
require_relative "Ruby/writer"
|
|
6
12
|
|
|
7
13
|
module Lerobot
|
|
8
14
|
module Dataset
|
|
9
15
|
module Ruby
|
|
16
|
+
VERSION = "0.2.0"
|
|
10
17
|
class Error < StandardError; end
|
|
11
18
|
end
|
|
12
19
|
end
|
data/lib/lerobot.rb
ADDED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require 'fileutils'
|
|
5
|
-
require_relative '../
|
|
6
|
-
require_relative '../ext/opencv/libopencv'
|
|
5
|
+
require_relative '../lib/lerobot'
|
|
7
6
|
|
|
8
7
|
root = File.expand_path('../output_dataset/robot_dataset', __dir__)
|
|
9
8
|
FileUtils.rm_rf(root)
|
data/test/sample.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: Lerobot-Dataset-Ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Harutodesu
|
|
@@ -70,8 +70,9 @@ files:
|
|
|
70
70
|
- ext/opencv/libopencv.cpp
|
|
71
71
|
- lib/Lerobot/Dataset/Ruby.rb
|
|
72
72
|
- lib/Lerobot/Dataset/Ruby/reader.rb
|
|
73
|
-
- lib/Lerobot/Dataset/Ruby/version.rb
|
|
74
73
|
- lib/Lerobot/Dataset/Ruby/writer.rb
|
|
74
|
+
- lib/lerobot-dataset-ruby.rb
|
|
75
|
+
- lib/lerobot.rb
|
|
75
76
|
- sig/Lerobot/Dataset/Ruby.rbs
|
|
76
77
|
- test/minimal_lerobot_check.rb
|
|
77
78
|
- test/sample.rb
|