David0tt / DeepGTAV

A system to easily extract ground truth training data for different machine learning tasks from GTAV
GNU General Public License v3.0
89 stars 9 forks source link

Stationary Camera Option #7

Closed danpresil closed 1 year ago

danpresil commented 2 years ago

Hey,

I want to generate data from the drone perspective and have the drone stay at the same location. Similar to a stationary security camera. I've tried modifying datageneration_VisDrone.py (disabled all the GoToLocation messages), but the drone always flies itself forward.

Is there an option to force the drone from moving?

Thanks!

David0tt commented 2 years ago

Hey,

This i currently not possible, however it would be relatively easy to implement in the DeepGTAV code.

A broad overview how I would implement it is:

  1. Add a variable "staticCameraPosition" to Scenario.cpp/.h that saves the wanted position
  2. Adapt Scenario::teleportToLocation such that it saves the teleport location to this variable
  3. Adapt the DataExport::setRenderingCam such that it does not set the camera position relative to the Vehicle, but sets it to the "staticCameraPosition". For simplicity you could use "cameraRotationOffset" for the rotation, as those are already given to DeepGTAV in the messages and would require minimal adaptation.

(4.) For clarity this behaviour could be a toggle e.g. "useStaticCamera" in the "Dataset" message

If you actually implement this, a pull request would be much appreciated :D

C-der-Baum commented 2 years ago

A hacky but very easy and fast workaround to this question is the following: Install the Aikido Free Cam Mod (https://de.gta5-mods.com/scripts/aikido-free-cam) and toggle it after starting your data generation script. Now you can freely move anywhere and stay at a static position.

No guarantees though that the ground truth data is correct all the time. However, in my experience it worked fine.

Can we close this?

C-der-Baum commented 1 year ago

Closed bc of inactivity

danpresil commented 1 year ago

A hacky but very easy and fast workaround to this question is the following: Install the Aikido Free Cam Mod (https://de.gta5-mods.com/scripts/aikido-free-cam) and toggle it after starting your data generation script. Now you can freely move anywhere and stay at a static position.

No guarantees though that the ground truth data is correct all the time. However, in my experience it worked fine.

Can we close this?

Hi again,

Using the the free cam mod while deepgta is recording causes the game to crash. Have you encountered a similar issue when you tried it?

Thanks!

Ben93kie commented 1 year ago

Hi from another account, yes, indeed I experienced that from time to time. It mostly happened when the game had to render many objects (in very high altitude for example). I'm not sure what the cause or the solution is unfortunately. You can try with other freecams (e.g. https://de.gta5-mods.com/scripts/freecamv-net) although I don't have experience with them. I only know that Vehicle Fly also works quite well (https://de.gta5-mods.com/scripts/vehicle-fly-10rel05) for some scenarios.

danpresil commented 1 year ago

UPDATE Aikido Free Cam Mod works great. image

I removed all the existing mod files that I had on the main GTAV folder and copied only the necessary ones.

Ben93kie commented 1 year ago

Great! Just out of curiosity, may I ask what you are working on?