Package edu.tufts.hrilab.vision.stm
Class CompositeSearchManager
java.lang.Object
edu.tufts.hrilab.vision.stm.SearchManager
edu.tufts.hrilab.vision.stm.CompositeSearchManager
-
Field Summary
Fields inherited from class edu.tufts.hrilab.vision.stm.SearchManager
analysisPolicy, defaultDetectorPredicate, description, incrementalDetector, incrementalImgProc, log, name, performanceInfo, serialProcessing, singleIteration, typeId, validFlag
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addConstraint
(Term term, boolean incrementalImgProcFlag, boolean incrementalDetectorFlag, boolean singleIterationFlag, boolean serialProcessingFlag) Add ImageProcessor or Detector constraint.boolean
More efficient alternative to addConstraint when all (or at least more than one) constraints are known at a time.void
addSearchManager
(List<Variable> variables, SearchManager searchManager) Add a sub-SearchManager to this SearchManager.Get all of the VisionProcessers in the processing chain for this search.boolean
Get incremental processing flag for all image processors.boolean
Get incremental processing flag for selected Detectors.Get the first VisionProcess in the processing chain for this search.Get the last VisionProcess in the processing chain for this search.Get a list of SearchManager IDs This is especially important for searches that contain sub-searches like relationboolean
boolean
boolean
Checks if at least one full detection -> tracking iteration has completed.boolean
Is this search currently running.Does the search meet the expectation of its set analysis policy.void
registerForNotification
(VisionProcess processor) This allows notifications to be sent between SearchManagers.boolean
removeConstraint
(Term term) Remove constraint from ImageProcessor or Detector.void
setConstraintsIncrementalProcessing
(boolean flag) Set the incremental processing flag for all image processors.void
setDetectorIncrementalProcessing
(boolean flag) Set the incremental processing flag for the Detectors.void
setSerialProcessing
(boolean flag) void
setSingleIteration
(boolean flag) void
setTimeOfLastClientUse
(long time) Update introspection info: time of last client use.protected final void
start()
Start type's detection, tracker, and constraints threads.protected final void
stop
(boolean wait) Stop constraints, detectors, and trackers if they are running.void
unregisterForNotification
(VisionProcess processor) This allows notifications between SearchManagers to be canceled.Methods inherited from class edu.tufts.hrilab.vision.stm.SearchManager
addConstraint, getDescriptors, getName, getTypeId, hasStarted, isStartCaller, isValid, matchesDescriptors, setName, shouldBeRunning, start, stop, toString
-
Method Details
-
addConstraints
public boolean addConstraints(Map<List<Variable>, ? extends List<? extends Term>> separatedDescriptors) More efficient alternative to addConstraint when all (or at least more than one) constraints are known at a time.- Parameters:
separatedDescriptors
-- Returns:
- if all constraints (descriptors) were met
-
addSearchManager
Description copied from class:SearchManager
Add a sub-SearchManager to this SearchManager. This is only valid for SearchManagers that are composed of other SearchManagers.- Overrides:
addSearchManager
in classSearchManager
-
addConstraint
public boolean addConstraint(Term term, boolean incrementalImgProcFlag, boolean incrementalDetectorFlag, boolean singleIterationFlag, boolean serialProcessingFlag) Add ImageProcessor or Detector constraint. This overloaded method should only be called from the GUI in order to maintain consistency across all uses from the Vision API.- Specified by:
addConstraint
in classSearchManager
incrementalImgProcFlag
- - if constraint is image processor, should run in incremental modeincrementalDetectorFlag
- - if constraint is detector, should run in incremental modesingleIterationFlag
- - if constraint should only run a single iterationserialProcessingFlag
- - if constraints should run in serial/parallel- Returns:
- boolean - if predicate mapped to a valid VisionProcessor
-
removeConstraint
Remove constraint from ImageProcessor or Detector. First tries to remove from ImageProcessor constraints, and if nothing was found matching the constraint, then tries to remove Detector (and replace with default Detector). NOTE: doesn't remove Detector yet!!- Specified by:
removeConstraint
in classSearchManager
- Parameters:
term
- to remove- Returns:
- True, if was successfully removed. If wasn't contained, returns false.
-
getRelatedTypeIds
Description copied from class:SearchManager
Get a list of SearchManager IDs This is especially important for searches that contain sub-searches like relation- Overrides:
getRelatedTypeIds
in classSearchManager
- Returns:
-
getFirstVisionProcessor
Description copied from class:SearchManager
Get the first VisionProcess in the processing chain for this search. This is usually a detector (but could conceivably be SaliencyOperators in the future).- Specified by:
getFirstVisionProcessor
in classSearchManager
- Returns:
-
getLastVisionProcessor
Description copied from class:SearchManager
Get the last VisionProcess in the processing chain for this search. This is usually the Tracker, but can be a Detector and Validator if there is no Tracker (as is the case with sub-SearchMangers in compositeSearchManagers).- Specified by:
getLastVisionProcessor
in classSearchManager
- Returns:
-
getAllVisionProcessors
Description copied from class:SearchManager
Get all of the VisionProcessers in the processing chain for this search. Currently used for the Vision Pipeline GUI- Specified by:
getAllVisionProcessors
in classSearchManager
-
registerForNotification
Description copied from class:SearchManager
This allows notifications to be sent between SearchManagers. This SearchManager's Tracker will notify the passed in processor.- Specified by:
registerForNotification
in classSearchManager
- Parameters:
processor
- VisionProcess to be notified
-
unregisterForNotification
Description copied from class:SearchManager
This allows notifications between SearchManagers to be canceled.- Specified by:
unregisterForNotification
in classSearchManager
- Parameters:
processor
- VisionProcess to be notified
-
setDetectorIncrementalProcessing
public void setDetectorIncrementalProcessing(boolean flag) Set the incremental processing flag for the Detectors.- Specified by:
setDetectorIncrementalProcessing
in classSearchManager
- Parameters:
flag
-
-
getDetectorIncrementalProcessing
public boolean getDetectorIncrementalProcessing()Get incremental processing flag for selected Detectors. Returns "incrementalDetectorFlag" if no detector exists (as default preference to use incremental processing).- Specified by:
getDetectorIncrementalProcessing
in classSearchManager
- Returns:
-
setConstraintsIncrementalProcessing
public void setConstraintsIncrementalProcessing(boolean flag) Set the incremental processing flag for all image processors.- Specified by:
setConstraintsIncrementalProcessing
in classSearchManager
- Parameters:
flag
-
-
getConstraintsIncrementalProcessing
public boolean getConstraintsIncrementalProcessing()Get incremental processing flag for all image processors. Will print error if they are not consistent. Returns true if no image processors exist (as default preference to use incremental processing).- Specified by:
getConstraintsIncrementalProcessing
in classSearchManager
- Returns:
-
setSingleIteration
public void setSingleIteration(boolean flag) - Specified by:
setSingleIteration
in classSearchManager
-
getSingleIteration
public boolean getSingleIteration()- Specified by:
getSingleIteration
in classSearchManager
-
setSerialProcessing
public void setSerialProcessing(boolean flag) - Specified by:
setSerialProcessing
in classSearchManager
-
getSerialProcessing
public boolean getSerialProcessing()- Specified by:
getSerialProcessing
in classSearchManager
-
isRunning
public boolean isRunning()Is this search currently running.- Specified by:
isRunning
in classSearchManager
- Returns:
-
start
protected final void start()Start type's detection, tracker, and constraints threads.- Specified by:
start
in classSearchManager
-
stop
protected final void stop(boolean wait) Stop constraints, detectors, and trackers if they are running.- Specified by:
stop
in classSearchManager
- Parameters:
wait
- if should wait for everything to stop before returning
-
hasIterationCompleted
public boolean hasIterationCompleted()Description copied from class:SearchManager
Checks if at least one full detection -> tracking iteration has completed. This is required in order to get detection results.- Specified by:
hasIterationCompleted
in classSearchManager
- Returns:
-
setTimeOfLastClientUse
public void setTimeOfLastClientUse(long time) Description copied from class:SearchManager
Update introspection info: time of last client use.- Specified by:
setTimeOfLastClientUse
in classSearchManager
-
meetsExpectations
Description copied from class:SearchManager
Does the search meet the expectation of its set analysis policy. This is for vision introspection.- Specified by:
meetsExpectations
in classSearchManager
- Returns:
-