Class VisionConsultant
java.lang.Object
edu.tufts.hrilab.consultant.Consultant<VisionReference>
edu.tufts.hrilab.vision.consultant.VisionConsultant
- All Implemented Interfaces:
ConsultantInterface
,VisionConsultantInterface
- Direct Known Subclasses:
MockVisionConsultant
,RealVisionConsultant
public abstract class VisionConsultant
extends Consultant<VisionReference>
implements VisionConsultantInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VisionInterface
To give the consultant access to vision api methods and the STM.protected final Map<Long,
Set<VisionReference>> Map from typeId to VisionReference.Fields inherited from class edu.tufts.hrilab.consultant.Consultant
defaultProperties, kbName, log, propertiesHandled, refConstructor, references, refNumber
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
assertProperties
(Symbol refId, List<Term> properties) Add properties to already existing object ref.boolean
an attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.convertToGrasps
(MemoryObject mo, List<? extends Term> constraints) protected <U> U
convertToType
(Object object, Class<U> type) getInitialDomain
(List<Term> query) Returns a list of currently known refIds (it takes a seq of Properties, to optionally do some pre-processing to return a list of relevant candidates).Get all POWER references known to vision.getReferences
(Long typeId) Get POWER reference for vision type ID.getReferences
(List<Term> properties) Get POWER reference that contain all specified properties.getTokenIds
(Symbol objectRef) Get token IDs for an object reference.Get tokens for an object reference.Get the underlying vision typeId associated with the object reference.getVariable
(Symbol objectRef) Get free-variable for specified object reference.void
loadReferencesFromFile
(String filename) Load pre-defined vision references from file via JSON.<U> U
localConvertToType
(Symbol refId, Class<U> type) <U> U
localConvertToType
(Symbol refId, Class<U> type, List<? extends Term> constraints) boolean
removeReference
(Symbol objectRef) This method should probably be removed.void
boolean
writeReferencesToFile
(String filename) Write vision references to file using JSON.Methods inherited from class edu.tufts.hrilab.consultant.Consultant
addPropertiesHandled, addReference, convertToType, convertToType, createReference, createReferences, getActivatedEntities, getAssertedProperties, getKBName, getNextReferenceId, getPropertiesHandled, getReference, getReferenceSummaries, getReferencesWithAllProperties, getReferencesWithAnyProperties, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, retractProperties, stripQuotesFromMorpheme, unregisterForNewPropertyNotification
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.tufts.hrilab.interfaces.ConsultantInterface
convertToType, convertToType, createReferences, getActivatedEntities, getAssertedProperties, getKBName, getPropertiesHandled, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, unregisterForNewPropertyNotification
-
Field Details
-
visionTypes
Map from typeId to VisionReference. -
visionComponent
To give the consultant access to vision api methods and the STM.
-
-
Constructor Details
-
VisionConsultant
-
-
Method Details
-
writeReferencesToFile
Write vision references to file using JSON.- Parameters:
filename
-- Returns:
-
loadReferencesFromFile
Load pre-defined vision references from file via JSON.- Parameters:
filename
-
-
assertProperties
Description copied from interface:ConsultantInterface
an attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.- Specified by:
assertProperties
in interfaceConsultantInterface
- Overrides:
assertProperties
in classConsultant<VisionReference>
- Parameters:
bindings
- list of bindings in tuple form (free-variable and refId pair)prob
- probability valueproperties
- list of Properties- Returns:
- whether the updated was successful?
-
assertProperties
Description copied from interface:ConsultantInterface
Add properties to already existing object ref. Each property should contain a connection to the existing ref either by refId or refId's variable.- Specified by:
assertProperties
in interfaceConsultantInterface
- Overrides:
assertProperties
in classConsultant<VisionReference>
- Returns:
-
getInitialDomain
Description copied from interface:ConsultantInterface
Returns a list of currently known refIds (it takes a seq of Properties, to optionally do some pre-processing to return a list of relevant candidates).- Specified by:
getInitialDomain
in interfaceConsultantInterface
- Overrides:
getInitialDomain
in classConsultant<VisionReference>
- Returns:
- list of currently known ids
-
setTypeId
-
getTypeId
Description copied from interface:VisionConsultantInterface
Get the underlying vision typeId associated with the object reference.- Specified by:
getTypeId
in interfaceVisionConsultantInterface
- Returns:
-
getTokens
Description copied from interface:VisionConsultantInterface
Get tokens for an object reference. For now, this method just calls the getTokens method that takes in a typeId. In the future, this should probably not automatically start a visual search, but instead look through LTM which currently doesn't exist.- Specified by:
getTokens
in interfaceVisionConsultantInterface
- Returns:
-
getTokenIds
Description copied from interface:VisionConsultantInterface
Get token IDs for an object reference. For now, this method just calls the getTokenIds method that takes in a typeId. In the future, this should probably not automatically start a visual search, but instead look through LTM which currently doesn't exist.- Specified by:
getTokenIds
in interfaceVisionConsultantInterface
- Returns:
-
removeReference
This method should probably be removed. Only added for object learning hack in AvailableLearners.- Parameters:
objectRef
-- Returns:
-
getReferences
Get POWER reference for vision type ID.- Parameters:
typeId
-- Returns:
-
getReferences
Get all POWER references known to vision.- Returns:
-
getReferences
Get POWER reference that contain all specified properties.- Parameters:
properties
-- Returns:
-
getVariable
Get free-variable for specified object reference.- Parameters:
objectRef
-- Returns:
-
localConvertToType
- Specified by:
localConvertToType
in classConsultant<VisionReference>
-
localConvertToType
- Specified by:
localConvertToType
in classConsultant<VisionReference>
-
convertToGrasps
-
convertToType
-