Package: machine-common-sense
Master Unit Tests:Development Unit Tests:Publish Documentation:Publish to PyPI:MCS Python PackagePython interface for interacting with MCS AI2Thor environment and running scenes. The latest release of the MCS Python library is0.7.4. You can find the latest documentationhere.Quickstart InstallationUsageDocumentationOther MCS GitHub RepositoriesTroubleshooting/EmailLicenseQuickstart InstallationVirtual EnvironmentsPython virtual environments are recommended when using the  Machine Common Sense package. All steps below presume the activation of the virtual environment. The developer can choose between traditional Python or Anaconda depending on need. These instructions work for Ubuntu Linux or MacOS. The MCS package has a minimum requirement of Python 3.7 regardless of Python distribution. As of 0.4.4, the MCS package will automatically download the Unity app release for that version. On the first run, the Unity app may take a while to start in order to download all the assets.Traditional Python Environment$python3.7-mvenv--promptmcsvenv
$sourcevenv/bin/activate(venv)$python-mpipinstall--upgradepipsetuptoolswheelAlternate Anaconda EnvironmentFor developers using Anaconda Python distributions instead of traditional Python, create your project virtual environment from the base Anaconda environment.(base)$condacreate-nmyenvpython=3.8(base)$condaenvlist# conda environments:#base*/home/user/anaconda3
myenv/home/user/anaconda3/envs/myenv(base)$condaactivatemyenv(myenv)$Install MCSWith the activated Python virtual environment, install the MCS package from the git url.(venv)$python-mpipinstallmachine-common-senseSample MCS Config FileThere may be additional settings you want to specify, which can be accomplished via the MCS configuration file. You can use thesample_config.inifile to start. This file has themetadatalevel set tooracle, which ensures that the data for all objects in a scene is returned, as well as object masks. For the purposes of this guide, we will pass this along to the MCS controller via theconfig_file_or_dict, which is outlined in theUsageexample below.For more in-depth information on configuration files and more about the different properties within, see the documentation about theMCS configuration fileUsageExample usage of the MCS library:importmachine_common_senseasmcs# Unity app file will be downloaded automaticallycontroller=mcs.create_controller(config_file_or_dict='./some-path/sample_config.ini')# Either load the scene data dict from an MCS scene config JSON file or create your own.# We will give you the training scene config JSON files and the format to make your own.scene_data=mcs.load_scene_json_file(scene_json_file_path)output=controller.start_scene(scene_data)# Use your machine learning algorithm to select your next action based on the scene# output (goal, actions, images, metadata, etc.) from your previous action.action,params=select_action(output)# Continue to select actions until your algorithm decides to stop.whileaction!='':controller.step(action,params)action,params=select_action(output)# For interaction-based goals, your series of selected actions will be scored.# For observation-based goals, you will pass a classification and a confidence# to the end_scene function here.controller.end_scene()DocumentationDocumentation HomeInstallation and SetupMCS Configuration FileExample UsagePython APIExample Scene Configuration FilesScene Configuration JSON SchemaDeveloper DocsOther MCS GitHub RepositoriesUnity codeScene GeneratorData IngestEvaluation Dashboard (UI)Troubleshootingmcs-ta2@machinecommonsense.comAcknowledgementsThis material is based upon work supported by the Defense Advanced Research Projects Agency (DARPA) and Naval Information Warfare Center, Pacific (NIWC Pacific) under Contract No. N6600119C4030. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the DARPA or NIWC Pacific.Apache 2 Open Source LicenseCode in this repository is made available byCACI(formerlyNext Century
Corporation) under theApache 2 Open Source License.  You may
freely download, use, and modify, in whole or in part, the source code
or release packages. Any restrictions or attribution requirements are
spelled out in the license file.  For more information about the
Apache license, please visit theThe Apache Software Foundation’s
License FAQ.Copyright 2021 CACI (formerly Next Century Corporation)