mbsantiago / whombat

Audio Annotation Tool for ML development
https://mbsantiago.github.io/whombat/
GNU General Public License v3.0
30 stars 4 forks source link

Error creating dataset from D drive #6

Open kaede-kmr opened 7 months ago

kaede-kmr commented 7 months ago

Hello. I've been struggling to find an easy to use wildlife call annotator recently and have been looking forward to using whobat, so I'm glad I can finally use it.

Description of issue

When I try to create a new dataset with a directory in the D drive (like D:/path/to/my/directory), I get a "Failed to create dataset" error on the GUI. No message is displayed in the terminal window. This error does not occur when a directory is in the C drive, the default storage. I store most of my audio data on the D drive as it's too large to store on the C drive. Do you have any idea how to get access to the D drive from whombat?

Sorry if I missed something already mentioned in the user guide.

Thank you for your efforts in developping whombat!

mbsantiago commented 7 months ago

Hey @kaede-kmr!

Thanks for giving Whombat a try!

Apologies for the minimal error message you encountered. Let me explain why this occurred: Whombat is designed to access files from a common directory, which defaults to your home directory. This is a security measure, particularly useful if Whombat is hosted on a shared server, ensuring the app cannot access sensitive files. However, it is indeed possible to customize this setting. Here's how to do it:

  1. Locate the Whombat files in the Application Data Folder. On Windows, this directory is typically found at C:\Users\<username>\AppData\Local\whombat. The AppData folder is usually hidden, but you can access it through the Windows Search or by enabling hidden folders in your Settings.
  2. Once you've found the Whombat data directory, look for a file named settings.json. You'll need to edit this file manually. Inside settings.json, you'll find a section resembling "audio_dir":"<your home>". Change the value to your desired directory (e.g., the D drive). Ensure to enclose the path in quotes to prevent the app from reverting to the original settings.

Any datasets you've previously created may become broken after this change, as Whombat relies on the audio_dir path to locate recordings. Also, in rare circumstances, the settings may revert to their original state. If Whombat fails to find the registered recordings, double-check the audio_dir path using these steps.

Many thanks for the issue! I'll ensure these instructions are included in the next version of our documentation and added to the FAQ for easy reference. Additionally, I'll work on providing more informative error messages in such situations in future releases.

Hope this helps, Santiago

mbsantiago commented 7 months ago

TODO

robinsandfort commented 7 months ago

Hi Santiago, thanks for your great work with Whombat! I have the same problem but different projects are also stored on different hard drives. I think it is not practical to change the autodir like that. Any idea on how to solve this? Greetings from Austria, Robin

mbsantiago commented 7 months ago

Hey Robin,

Thanks for your kind words! 😊

Yeah, supporting datasets across different disks in Whombat would be great, and it's a common scenario. Unfortunately, at the moment, Whombat doesn't directly support this feature.

However, there's a workaround, although it's a bit impractical. Here's how you can set it up:

  1. Start by installing Whombat via pip: pip install whombat.
  2. After installation, you'll need to run Whombat through the terminal using the command WHOMBAT_DATA_DIR=<path_to_instance1> python -m whombat. This command directs Whombat to store all data and settings in the specified directory, rather than the default location. You'll need to use the same command every time to ensure Whombat reads from that location.
  3. You can adjust the audio_dir in the settings file created in this directory to point to your first drive.
  4. Repeat steps 2 and 3 for another directory, adjusting the settings accordingly for the other drive.

While changing how Whombat handles file paths to support this scenario would be an ideal solution, it might require significant changes to the codebase and may take some time to implement. But I'll add it to the TODO list.

Anyways, thanks again for giving Whombat a try, and let me know if you have further questions.

Santiago