public class ExternPedestrianComparerUsingAttr extends Object implements PedestrianComparerUsingAttr
Request format
16 bytes - Request UUID.
foreach pedestrian (totally 2): {
1 byte - 0: Full data; 1: Feature only (featFlag)
if featFlag: Feature.LENGTH bytes - Known feature.
else: {
4 bytes - Tracklet length (number of bounding boxes).
foreach bounding box: {
16 bytes - Bounding box data (x, y, width, height).
width * height * 3 bytes - Image data.
}
4 bytes - Length of JSON string representing attributes (jsonLen).
jsonLen bytes - UTF-8 JSON string representing attributes.
}
}
Response format
16 bytes - Request UUID.
4 bytes - Similarity.
foreach pedestrian (totally 2): {
1 byte - Whether returning the feature vector (retFlag).
if retFlag: Feature.LENGTH bytes (Optional) - The feature vector of the pedestrian.
}
Modifier and Type | Class and Description |
---|---|
protected class |
ExternPedestrianComparerUsingAttr.RequestMessage
The RequestMessage is a class specializing the format of request
messages
of ExternPedestrianComparerWithAttr to extern solvers.
|
private class |
ExternPedestrianComparerUsingAttr.ResultListener
The ResultListener class listens to the socket for comparison
results
then store them into the result pool.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
enableFeatureOnly
|
private Thread |
resListeningThread
|
private Map<UUID,Float> |
resultPool
|
private Socket |
socket
|
Constructor and Description |
---|
ExternPedestrianComparerUsingAttr(InetAddress solverAddress,
int port)
Constructor of ExternPedestrianComparerWithAttr specifying extern
solver's address and listening port.
|
ExternPedestrianComparerUsingAttr(InetAddress solverAddress,
int port,
boolean enableFeatureOnly)
Constructor of ExternPedestrianComparerWithAttr specifying extern
solver's address and listening port.
|
Modifier and Type | Method and Description |
---|---|
float |
compare(PedestrianInfo personA,
PedestrianInfo personB)
Compare two pedestrians each given in a track with attributes.
|
private final Socket socket
private Thread resListeningThread
private boolean enableFeatureOnly
public ExternPedestrianComparerUsingAttr(@Nonnull InetAddress solverAddress, int port) throws IOException
solverAddress
- the address of the solver.port
- the port the solver is listening to.IOException
- if an I/O
error occurs when creating the socket.
public ExternPedestrianComparerUsingAttr(@Nonnull InetAddress solverAddress, int port, boolean enableFeatureOnly) throws IOException
solverAddress
- the address of the solver.port
- the port the solver is listening to.enableFeatureOnly
- whether to enable comparing pedestrians with
feature only.
IOException
- if an I/O
error occurs when creating the socket.
public float compare(@Nonnull PedestrianInfo personA, @Nonnull PedestrianInfo personB) throws Exception
compare
in
interface PedestrianComparerUsingAttr
personA
- The first pedestrian.personB
- The second pedestrian.Exception