Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Autocnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Autocnet
Commits
79d4325f
Commit
79d4325f
authored
Dec 7, 2021
by
Gavin
Browse files
Options
Downloads
Patches
Plain Diff
updated node.py to use logging
parent
43de44f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autocnet/graph/node.py
+7
-5
7 additions, 5 deletions
autocnet/graph/node.py
with
7 additions
and
5 deletions
autocnet/graph/node.py
+
7
−
5
View file @
79d4325f
from
collections
import
defaultdict
,
MutableMapping
import
itertools
import
os
import
warn
ing
s
import
logg
ing
from
csmapi
import
csmapi
import
numpy
as
np
...
...
@@ -22,6 +22,8 @@ from autocnet.io import keypoints as io_keypoints
from
autocnet.vis.graph_view
import
plot_node
from
autocnet.utils
import
utils
# set up the logging file
log
=
logging
.
getLogger
(
__name__
)
class
Node
(
dict
,
MutableMapping
):
"""
...
...
@@ -395,7 +397,7 @@ class Node(dict, MutableMapping):
def
project_keypoints
(
self
):
if
self
.
camera
is
None
:
# Without a camera, it is not possible to project
warning
s
.
warn
(
'
Unable to project points, no camera available.
'
)
log
.
warning
(
'
Unable to project points, no camera available.
'
)
return
False
# Project the sift keypoints to the ground
def
func
(
row
,
args
):
...
...
@@ -444,7 +446,7 @@ class Node(dict, MutableMapping):
PATH to the directory for output and base file name
"""
if
self
.
keypoints
.
empty
:
warning
s
.
warn
(
'
Node {} has not had features extracted.
'
.
format
(
self
[
'
node_id
'
]))
log
.
warning
(
'
Node {} has not had features extracted.
'
.
format
(
self
[
'
node_id
'
]))
return
io_keypoints
.
to_npy
(
self
.
keypoints
,
self
.
descriptors
,
...
...
@@ -524,7 +526,7 @@ class NetworkNode(Node):
try
:
fp
,
cam_type
=
self
.
footprint
except
Exception
as
e
:
warning
s
.
warn
(
'
Unable to generate image footprint.
\n
{}
'
.
format
(
e
))
log
.
warning
(
'
Unable to generate image footprint.
\n
{}
'
.
format
(
e
))
fp
=
cam_type
=
None
# Create the image
i
=
Images
(
name
=
self
[
'
image_name
'
],
...
...
@@ -638,7 +640,7 @@ class NetworkNode(Node):
with
open
(
isdpath
,
'
w
'
)
as
f
:
json
.
dump
(
response
,
f
)
except
Exception
as
e
:
warning
s
.
warn
(
'
Failed to write JSON ISD for image {}.
\n
{}
'
.
format
(
self
[
'
image_path
'
],
e
))
log
.
warning
(
'
Failed to write JSON ISD for image {}.
\n
{}
'
.
format
(
self
[
'
image_path
'
],
e
))
isd
=
csmapi
.
Isd
(
self
[
'
image_path
'
])
plugin
=
csmapi
.
Plugin
.
findPlugin
(
'
UsgsAstroPluginCSM
'
)
self
.
_camera
=
plugin
.
constructModelFromISD
(
isd
,
model_name
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment