Skip to content

SeatizenDOI/zenodo-tools

Repository files navigation

GitHub contributors GitHub forks GitHub issues License GitHub pull requests GitHub stars GitHub watchers

Zenodo tools

This repository provides tools for uploading, downloading and manipulating seatizen sessions on the zenodo platform

Summary

Installation

To ensure a consistent environment for all users, this project uses a Conda environment defined in a zenodo_env.yml file. Follow these steps to set up your environment:

  1. Install Conda: If you do not have Conda installed, download and install Miniconda or Anaconda.

  2. Create the Conda Environment: Navigate to the root of the project directory and run the following command to create a new environment from the zenodo_env.yml file:

    conda env create -f zenodo_env.yml
  3. Activate the Environment: Once the environment is created, activate it using:

    conda activate zenodo_env
  4. Create config.json: To use this repository, you need a config.json file at the root of the project containing your own ACCESS_TOKEN:

    {
        "ACCESS_TOKEN": "ACCESS_TOKEN",
        "ZENODO_LINK": "https://zenodo.org/api/deposit/depositions"
    }
  5. Other lib: Install mod-spatialite. Here for ubuntu 22.04

sudo apt-get install libsqlite3-mod-spatialite
  1. Troubleshooting: If sqlite3.OperationalError: /home/bioeos/miniconda3/envs/zenodo_env/bin/../lib/libstdc++.so.6: version 'GLIBCXX_3.4.32' not found (required by /usr/lib/x86_64-linux-gnu/libproj.so.25)

Use:

sudo find / -name libstdc++.so.6 to find your local file.

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX to check if the version 'GLIBCXX_3.4.32' is present.

Then:

ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/bioeos/miniconda3/envs/zenodo_env/lib/libstdc++.so
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/bioeos/miniconda3/envs/zenodo_env/lib/libstdc++.so.6

Cheatsheet command to generate all from seatizen data

python zenodo-manager.py -efol -pfol /media/bioeos/E/2015_plancha_session/ -ulo -ffi -fr -ne # Force inserting frame in database with no export and regenerate database.
python zenodo-manager.py -efol -pfol /media/bioeos/E/poulain_syc -ulo -ffi -ne # Force inserting frame in database with no export.
python zenodo-manager.py -ecsv -pcsv ../../Bioeos/OUTPUT_DATA/zenodo_suivi/processed_data_without_2015.csv -ulo -la ../../Bioeos/annotations_some_image/Export_human/ -ne # Add frames and import annotations.
python zenodo-manager.py -eno -ulo -ssn 1 # Update database data (all class and label).
python zenodo-manager.py -eno -ulo # Export all files.

Qgis command to load data

-- Load prediction map of a class 
SELECT f.GPSPosition, mlc.name, mlp.score
FROM multilabel_prediction mlp
JOIN frame f ON f.id = mlp.frame_id
JOIN multilabel_class mlc on mlc.id = mlp.ml_class_id;

-- Load deposit linestring
SELECT d.session_name, d.platform_type, dl.footprint_linestring
FROM deposit_linestring dl
JOIN deposit d on d.doi = dl.deposit_doi
WHERE dl.footprint_linestring NOT NULL;

Contributing

Contributions are welcome! To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or fix.
  3. Commit your changes with clear, descriptive messages.
  4. Push your branch and submit a pull request.

License

This framework is distributed under the CC0-1.0 license. See LICENSE for more information.