Giter VIP home page Giter VIP logo

gestures-miccai-2021's Introduction

GESTURES – MICCAI 2021

This repository contains the training scripts used in Pérez-García et al., 2021, Transfer Learning of Deep Spatiotemporal Networks to Model Arbitrarily Long Videos of Seizures, 24th International Conference on Medical Image Computing and Computer Assisted Intervention (MICCAI).

The (features) dataset is publicly available at the UCL Research Data Repository.

GESTURES diagram

GESTURES stands for generalized epileptic seizure classification from video-telemetry using recurrent convolutional neural networks.

Citation

If you use this code or the dataset for your research, please cite the paper and the dataset appropriately.

Installation

Using conda is recommended:

conda create -n miccai-gestures python=3.7 ipython -y && conda activate miccai-gestures

Using light-the-torch is recommended to install the best version of PyTorch automatically:

pip install light-the-torch
ltt install torch==1.7.0 torchvision==0.4.2

Then, clone this repository and install the rest of the requirements:

git clone https://github.com/fepegar/gestures-miccai-2021.git
cd gestures-miccai-2021
pip install -r requirements.txt

Finally, download the dataset:

curl -L -o dataset.zip https://ndownloader.figshare.com/files/28668096
unzip dataset.zip -d dataset

Training

GAMMA=4  # gamma parameter for Beta distribution
AGG=blstm  # aggregation mode. Can be "mean", "lstm" or "blstm"
N=16  # number of segments
K=0  # fold for k-fold cross-validation
python train_features_lstm.py \
  --print-config \
  with \
  experiment_name=lstm_feats_jitter_${GAMMA}_agg_${AGG}_segs_${N} \
  jitter_mode=${GAMMA} \
  aggregation=${AGG} \
  num_segments=${N} \
  fold=${K}

gestures-miccai-2021's People

Contributors

fepegar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gestures-miccai-2021's Issues

Suggest to loosen the dependency on sacred

Hi, your project gestures-miccai-2021 requires "sacred==0.8.1" in its dependency. After analyzing the source code, we found that some other versions of sacred can also be suitable without affecting your project, i.e., sacred 0.8.0. Therefore, we suggest to loosen the dependency on sacred from "sacred==0.8.1" to "sacred>=0.8.0,<=0.8.1" to avoid any possible conflict for importing more packages or for downstream projects that may use gestures-miccai-2021.

May I pull a request to loosen the dependency on sacred?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



For your reference, here are details in our analysis.

Your project gestures-miccai-2021(commit id: f6d947f) directly uses 3 APIs from package sacred.

sacred.experiment.Experiment.__init__, sacred.observers.file_storage.FileStorageObserver.__init__, sacred.observers.slack.SlackObserver.from_config

From which, 48 functions are then indirectly called, including 30 sacred's internal APIs and 18 outsider APIs, as follows (neglecting some repeated function occurrences).

[/fepegar/gestures-miccai-2021]
+--sacred.experiment.Experiment.__init__
|      +--sacred.host_info.check_additional_host_info
|      +--sacred.experiment.gather_command_line_options
|      |      +--sacred.utils.get_inheritors
|      |      +--warnings.warn
|      +--inspect.stack
|      +--os.path.basename
|      +--sacred.ingredient.Ingredient.__init__
|      |      +--collections.OrderedDict
|      |      +--inspect.stack
|      |      +--os.path.dirname
|      |      +--os.path.abspath
|      |      +--sacred.dependencies.gather_sources_and_dependencies
|      |      |      +--sacred.dependencies.get_main_file
|      |      |      |      +--os.path.abspath
|      |      |      |      +--sacred.dependencies.Source.create
|      |      |      |      |      +--os.path.exists
|      |      |      |      |      +--sacred.dependencies.get_py_file_if_possible
|      |      |      |      |      |      +--os.path.exists
|      |      |      |      |      +--os.path.abspath
|      |      |      |      |      +--sacred.dependencies.get_commit_if_possible
|      |      |      |      |      |      +--os.path.dirname
|      |      |      |      |      |      +--git.Repo
|      |      |      |      |      |      +--git.Repo.remote
|      |      |      |      |      |      +--git.Repo.is_dirty
|      |      |      |      |      +--sacred.dependencies.Source.__init__
|      |      |      |      |      +--sacred.dependencies.get_digest
|      |      |      |      |      |      +--hashlib.md5
|      |      |      |      +--os.path.dirname
|      |      |      +--sacred.dependencies.PackageDependency.create
|      |      |      |      +--sacred.dependencies.PackageDependency.__init__
|      +--sacred.ingredient.Ingredient.command
|      |      +--sacred.ingredient.Ingredient.capture
|      |      |      +--sacred.config.captured_function.create_captured_function
|      |      |      |      +--sacred.config.signature.Signature.__init__
|      |      |      |      |      +--sacred.config.signature.get_argspec
|      |      |      |      |      |      +--inspect.signature
|      |      |      |      |      |      +--collections.OrderedDict
|      |      |      |      +--sacred.config.captured_function.captured_function
|      |      |      |      |      +--sacred.config.custom_containers.fallback_dict
|      |      |      |      |      +--sacred.randomness.get_seed
|      |      |      |      |      |      +--random.randint
|      |      |      |      |      +--sacred.randomness.create_rnd
|      |      |      |      |      |      +--random.Random
|      |      |      |      |      +--time.time
|      |      |      |      |      +--sacred.utils.ConfigError.track
|      |      |      |      |      |      +--sacred.utils.join_paths
|      |      |      |      |      +--datetime.timedelta
|      +--sacred.commands.print_named_configs
|      |      +--collections.OrderedDict
|      |      +--sacred.commands._format_named_configs
|      |      |      +--sacred.commands._format_named_config
+--sacred.observers.file_storage.FileStorageObserver.__init__
|      +--pathlib.Path
|      +--os.path.exists
|      +--sacred.observers.file_storage.FileStorageObserver.initialize
+--sacred.observers.slack.SlackObserver.from_config
|      +--sacred.config.config_files.load_config_file
|      |      +--sacred.config.config_files.get_handler
|      |      |      +--os.path.splitext

We scan sacred's versions among [0.8.0] and 0.8.1, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 0.8.1(original) 0.8.0
['sacred.observers.mongo.MongoObserver.insert', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver._determine_run_dir', 'sacred.serializer.NumpyGenericHandler.flatten', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.log_metrics', 'sacred.serializer.NumpyArrayHandler.flatten', 'sacred.observers.mongo.QueuedMongoObserver', 'sacred.serializer.PandasDataframeHandler', 'sacred.observers.mongo.QueuedMongoObserver.__init__', 'sacred.observers.gcs_observer._is_valid_bucket', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.interrupted_event', 'sacred.observers.gcs_observer.gcs_option', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.heartbeat_event', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.failed_event', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.artifact_event', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.resource_event', 'sacred.serializer.NumpyArrayHandler.restore', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver', 'sacred.experiment.Experiment', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.find_or_save', 'sacred.observers.queue.QueueObserver', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.save_file_to_base', 'sacred.serializer.NumpyArrayHandler', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.started_event', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver._objects_exist_in_dir', 'sacred.observers.mongo.QueueCompatibleMongoObserver.save', 'sacred.serializer.PandasDataframeHandler.flatten', 'sacred.observers.mongo.QueueCompatibleMongoObserver', 'sacred.observers.mongo.MongoObserver', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver._list_gcs_subdirs', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.__eq__', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.completed_event', 'sacred.serializer.NumpyGenericHandler.restore', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.save_directory', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.put_data', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.queued_event', 'sacred.serializer.NumpyGenericHandler', 'sacred.observers.queue.QueueObserver.__init__', 'sacred.observers.queue.QueueObserver._run', 'sacred.experiment.Experiment._check_command', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.save_cout', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.save_file', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.__init__', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.save_sources', 'sacred.serializer.PandasDataframeHandler.restore', 'sacred.observers.gcs_observer.gcs_join', 'sacred.observers.gcs_observer.GoogleCloudStorageObserver.save_json', 'sacred.observers.mongo.MongoObserver._try_to_detect_content_type']

As for other packages, the APIs of @outside_package_name are called by sacred in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on sacred from "sacred==0.8.1" to "sacred>=0.8.0,<=0.8.1". This will improve the applicability of gestures-miccai-2021 and reduce the possibility of any further dependency conflict with other projects/packages.

Dependencies

Best Fernando,
thanks for providing this repository alongside the feature dataset and the paper. This is essential work!

I have run into a few issues replicating it, though.
What specific anaconda version were you using? I had to add protobuf~=3.19.0 and pillow<7 to the requirements to get your code to execute. Also, I created the slack.json for sacred and changed a few file paths in your code. However, it still fails on: train_features_lstm failed after 3 seconds with AttributeError: 'DataFrame' object has no attribute 'RatioGTCS'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.