forked from liuliu/ccv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added regression tests. it is a test set for actual bugs, thus, any of them is one defect that once existed in the code base.
- Loading branch information
Showing
33 changed files
with
328 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
*.swp | ||
tags | ||
gh-pages | ||
test/*.tests | ||
*.tests | ||
test/*_test | ||
test/*.jpg | ||
test/*.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env ruby | ||
|
||
exit unless ARGV.length == 1 | ||
|
||
files = Dir.glob(ARGV[0] + '/*.txt') | ||
|
||
files.each do |file| | ||
name = nil; | ||
boxes = Array.new | ||
File.new(file).each_line do |line| | ||
next if line[0] == '#' | ||
name = line[line.rindex('/') + 1, line.rindex('"') - (line.rindex('/') + 1)] if line[0, 14].downcase == "image filename" | ||
if line[0, 16].downcase == "bounding box for" | ||
i = line.scan(/object\s*(\d+)/)[0][0].to_i | ||
coord = line.scan(/\((\d+),\s*(\d+)\)\s*-\s*\((\d+),\s*(\d+)\)/)[0] | ||
boxes[i - 1] = { :x => coord[0].to_i, :y => coord[1].to_i, :width => coord[2].to_i - coord[0].to_i, :height => coord[3].to_i - coord[1].to_i } | ||
end | ||
end | ||
boxes.each { |coord| print name + " " + coord[:x].to_s + " " + coord[:y].to_s + " " + coord[:width].to_s + " " + coord[:height].to_s + "\n" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.