public class Neo4jConnector extends GraphDatabaseConnector
GraphDatabaseConnector.Link
Modifier and Type | Field and Description |
---|---|
private org.neo4j.driver.v1.Driver |
driver
|
Constructor and Description |
---|
Neo4jConnector()
|
Modifier and Type | Method and Description |
---|---|
private String |
calTrackletStartTime(int trackletStartIdx,
String videoStartTime)
Calculate the start time of a tracklet based on start frame
index, fps
and the start time of the video.
|
protected void |
finalize()
|
GraphDatabaseConnector.Link[]
|
getLinkedPedestrians(String nodeID)
Get relations: (nodA)-[SIMILARITY]-(nodeB)
|
Attributes |
getPedestrianAttributes(String nodeID)
Get the attributes of a pedestrian.
|
float |
getPedestrianSimilarity(String idA,
String idB)
Get the similarity between two pedestrians.
|
String |
getTrackletSavingDir(String nodeID)
Get the path of the directory saving the tracklet of a
pedestrian.
|
void |
setPedestrianAttributes(String nodeID,
Attributes attr)
Set the attributes of a pedestrian.
|
void |
setPedestrianSimilarity(String idA,
String idB,
float similarity)
Set the similarity between two pedestrians.
|
void |
setTrackletSavingPath(String nodeID,
String path)
Set the path of the directory saving the tracklet of a
pedestrian.
|
protected void finalize() throws Throwable
private String calTrackletStartTime(@Nonnull int trackletStartIdx, @Nonnull String videoStartTime)
trackletStartIdx
- start frame index of a tracklet.videoStartTime
- start time of the video.public void setTrackletSavingPath(@Nonnull String nodeID, @Nonnull String path)
GraphDatabaseConnector
setTrackletSavingPath
in
class GraphDatabaseConnector
nodeID
- the id of the pedestrian.path
- the path of the directory saving the tracklet of the
pedestrian.
public String getTrackletSavingDir(@Nonnull String nodeID) throws NoSuchElementException
GraphDatabaseConnector
getTrackletSavingDir
in
class GraphDatabaseConnector
nodeID
- the id of the pedestrian.NoSuchElementException
-
On failure finding the pedestrian.
public void setPedestrianSimilarity(@Nonnull String idA, @Nonnull String idB, float similarity)
GraphDatabaseConnector
setPedestrianSimilarity
in
class GraphDatabaseConnector
idA
- the ID of the first pedestrian.idB
- the ID of the second pedestrian.similarity
- the similarity between them.public float getPedestrianSimilarity(@Nonnull String idA, @Nonnull String idB) throws NoSuchElementException
GraphDatabaseConnector
getPedestrianSimilarity
in
class GraphDatabaseConnector
idA
- the ID of the first pedestrian.idB
- the ID of the second pedestrian.NoSuchElementException
-
On failure finding any of these two pedestrian, or when there
is no link between them.
public void setPedestrianAttributes(@Nonnull String nodeID, @Nonnull Attributes attr)
GraphDatabaseConnector
setPedestrianAttributes
in
class GraphDatabaseConnector
nodeID
- the ID of the pedestrian.attr
- the attributes of the pedestrian.public Attributes getPedestrianAttributes(@Nonnull String nodeID) throws NoSuchElementException
GraphDatabaseConnector
getPedestrianAttributes
in
class GraphDatabaseConnector
nodeID
- the ID of the pedestrian.NoSuchElementException
-
On failure finding the pedestrian.
public GraphDatabaseConnector.Link[] getLinkedPedestrians(@Nonnull String nodeID) throws NoSuchElementException
GraphDatabaseConnector
getLinkedPedestrians
in
class GraphDatabaseConnector
nodeID
- the ID of the pedestrian.NoSuchElementException
-
On failure finding the pedestrian.