/
dbgFullLocalGraphCopy.jl
123 lines (69 loc) · 1.96 KB
/
dbgFullLocalGraphCopy.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#debug fullLocalGraphCopy!
using Caesar, RoME, IncrementalInference
using CloudGraphs, Neo4j
# using Distributions
using JSON
using KernelDensityEstimate
using Base.Test
## Uncomment out for command line operation
# cloudGraph, addrdict = standardcloudgraphsetup(nparticles=true)
# session = addrdict["session"]
# Nparticles = parse(Int,addrdict["num particles"])
# interactive operation
session = "SESSROX"
Nparticles = 100
include(joinpath(dirname(@__FILE__),"blandauthremote.jl"))
fg = initfg(sessionname=session, cloudgraph=cloudGraph)
# setDBAllReady!(fg)
setBackendWorkingSet!(session)
fullLocalGraphCopy!(fg)
IDs = getAllExVertexNeoIDs(conn, sessionname=fg.sessionname)
tosee = Dict()
tosee2 = Dict()
for i in 1:length(IDs)
vid, nid = IDs[i]
tosee[vid] = nid
tosee2[nid] = vid
end
tosee2[149088]
writeGraphPdf(fg)
# @async run(`evince fg.pdf`)
tree = wipeBuildNewTree!(fg,drawpdf=true)
# @async run(`evince bt.pdf`)
spyCliqMat(tree, :l200050)
inferOverTreeR!(fg, tree, N=N, dbg=true)
# Some inspection methods to see what is going on
spyCliqMat(tree, :l200050)
plotMCMC(tree, :l200050)
plotPriorsAtCliq(tree, :l200050, :l200050, dims=[1;2], levels=1)
plotUpMsgsAtCliq(tree, :l200050, :l200050, marg=[1;2])
# basic plotting of Pose2D and landmarks
drawPosesLandms(fg ,spscale=0.5)
lbll=:l200050
cliq = whichCliq(tree, string(lbll))
cliqdbg = cliq.attributes["debug"]
vidx = 1
for lb in cliqdbg.mcmc[1].lbls
if lb == lbll
break;
else
vidx += 1
end
end
ppp = kde!(cliqdbg.mcmc[3].prods[vidx].product)
plotKDE(ppp)
vc = startdefaultvisualization(draworigin=true)
drawposepoints!(vc, fg, :x4)
visualizeallposes!(vc, fg, drawlandms=false, drawtype=:fit)
drawPoses(fg,from=4,to=4)
# prior on :x1 issue
fc = getVert(fg, 100007)
vid = fg.IDs[:l200050]
vid = fg.IDs[:x4]
fc
Profile.clear()
@profile pts = evalFactor2(fg, fc, vid)
plotKDE(kde!(pts[1:2,:]))
getSample( getData(fc).fnc.usrfnc!, 100 )
plotKDE(getData(fc).fnc.usrfnc!.range)
#