Skip to content

Commit

Permalink
Merge 5699be9 into 5b7095e
Browse files Browse the repository at this point in the history
  • Loading branch information
iuliancioarca committed Sep 18, 2019
2 parents 5b7095e + 5699be9 commit a7a9df9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ function download_dataset(name::String = "all")
voc_dir = joinpath(datasets_dir, "voc")
voc_root = joinpath(voc_dir, "VOCdevkit")
isdir(voc_root) && rm(voc_root, force = true, recursive = true)
@info "Downloading dataset..."
tmploc = download("https://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar")
@info "Extracting..."
run(`tar xf $tmploc -C $voc_dir`)
@info "Completed"
end
end
10 changes: 5 additions & 5 deletions src/makierendering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ function renderResult(img::Array{Float32}, predictions::Vector{YOLO.PredictLabel
img_w = settings.image_shape[1]
img_h = settings.image_shape[2]
img_rgb = imgslice_to_rgbimg(img)
scene = Scene(resolution = size(img_rgb') .* 2 )
image!(scene, img_rgb, scale_plot=false, show_axis = false, limits = FRect(0, 0, img_h, img_w))
rotate!(scene, -0.5pi)
scene = Makie.Scene(resolution = size(img_rgb') .* 2 )
Makie.image!(scene, img_rgb, scale_plot=false, show_axis = false, limits = Makie.FRect(0, 0, img_h, img_w))
Makie.rotate!(scene, -0.5pi)

for p in predictions
col = cols[p.class]
rect = [p.bbox.y*img_h, p.bbox.x*img_w, p.bbox.h*img_h, p.bbox.w*img_w]
poly!(scene, [Rectangle{Float32}(rect...)], color=RGBA(red(col),blue(col),green(col),clamp(p.conf*1.3,0.2,0.6)))
Makie.poly!(scene, [Rectangle{Float32}(rect...)], color=RGBA(red(col),blue(col),green(col),clamp(p.conf*1.3,0.2,0.6)))
name = get(settings.numsdic,p.class,"")
conf_rounded = round(p.conf, digits=2)
text!(scene, "$name\n$(conf_rounded)",
Makie.text!(scene, "$name\n$(conf_rounded)",
position = (rect[1], rect[2]),
align = (:left, :top),
colo = :black,
Expand Down

0 comments on commit a7a9df9

Please sign in to comment.