Skip to content

Commit

Permalink
still fixign gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
BenUCL committed Aug 30, 2023
1 parent 138d894 commit 08e0d72
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ code/simclr-pytorch-reefs/evaluation/model_states_i2map_simclr
scratch/baseline
code/simclr-pytorch-reefs/evaluation/embeddings/raw_embeddings/
code/simclr-pytorch-reefs/evaluation/embeddings/raw_embeddings
code/simclr-pytorch-reefs/evaluation/embeddings/log_metrics
code/simclr-pytorch-reefs/evaluation/log_metrics



Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# import torch\n",
"# import torch.nn as nn\n",
"# import torchvision.models as models\n",
"# from torch.utils.data import DataLoader"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Importing necessary modules\n",
"import json\n",
"\n",
"# Load the JSON file\n",
"json_path = '/home/ben/reef-audio-representation-learning/data/dataset.json'\n",
"with open(json_path, 'r') as f:\n",
" dataset_json = json.load(f)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# Initialize an empty list to store the filtered entries\n",
"filtered_entries = []\n",
"\n",
"# Filter entries based on 'data_type' and 'dataset'\n",
"for entry in dataset_json['audio']:\n",
" if entry['data_type'] == 'test_data' and entry['dataset'] == 'test_australia':\n",
" # Convert the 'class' to numeric\n",
" numeric_class = int(entry['class'].replace('class', ''))\n",
" \n",
" # Create a new dictionary with 'file_path' and numeric 'class'\n",
" filtered_entry = {\n",
" 'file_name': entry['file_name'],\n",
" 'class': numeric_class\n",
" }\n",
" \n",
" # Append the filtered entry to the list\n",
" filtered_entries.append(filtered_entry)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "simclr_pytorch_reefs",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}
Binary file not shown.

0 comments on commit 08e0d72

Please sign in to comment.