Skip to content

ShadowrunnerLeon/SmartCompanion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Targets

  • add cross-platform (for now Windows)

Description

This project is an example of a game system using voice recognition modules and computer vision. In short, there is a character that receives voice commands from a person, recognizes them, creates a screenshot, analyzes it for enemies under specified conditions (for example, searching for players wearing red clothes), calculates the angle of turn and makes a shooting. The system provides for the addition of new modules and commands.

Libraries

  • Vosk 0.3.45 (speech recognition)
  • PortAudio 19.7.0 (reading data from the microphone)
  • OpenCV 4.7.0 (computer vision)
  • Simpleson 1.1.0 (work with json, was chosen because of its small size)

Architecture

  • SmartCompanion - the set of classes responsible for character creation, shooting, and projectile generation. Inside SmartCompanionGameMode is a pointer to CommandHandler.
  • CommandHandler is a class that implements the FRunnable interface and handles recognized commands.
  • UESpeechRecognition - reading data from the microphone, recognizing and parsing json.
  • UEComputerVision - image preprocessing and postprocessing, rotation angle calculation.

Models

  • vosk-model-small-en-us-0.15
  • YOLOv8s

Screenshots

  • Speech Recognition

Image alt

  • Computer Vision

Image alt

P.S.

  • The OpenCV library was built from source code rather than using an off-the-shelf library. The IPP flags were disabled during the build (see useful links) and ONNX was connected. In any case, if you are not satisfied with the library version in this project, build OpenCV from source.

  • A separate dll was created for the computer vision module because memory leaks occurred when working with UE. If you need to change the code or rebuild the dll, see DllProjects.

  • Relevant to Shipping. After building and running the application, there is a possibility that the project will not use the maximum resolution of your monitor, which will lead to incorrect operation of the computer vision module. This link will help you (https://forums.unrealengine.com/t/how-to-set-resolution-of-packaged-game/18950/16).

Useful links

General

UE5 - adding libs

Computer Vision

Speech Recognition