<jupyter_start><jupyter_text>Part 1: Local VAME Project with GPU  Note: Open this jupyter notebook in your VAME environment.  Initialize VAME<jupyter_code>import vame
import tkinter
from tkinter import filedialog<jupyter_output><empty_output><jupyter_text>Download VAME Example Data Download `video-1.csv` and `video-1.mp4` from here: https://drive.google.com/drive/folders/1feCukw2H0teLvaPbwelhD2E2ns_viHFX?usp=sharing and save it to your own Google Drive.  Step 1: Create a new VAME project<jupyter_code>project = 'NewVAMEProject_20211201'
working_directory = filedialog.askdirectory(title = 'Choose a directory for new VAME project')
videos = filedialog.askopenfilenames(title = 'Choose raw videos for new VAME project')<jupyter_output><empty_output><jupyter_text>Step 1.1: Initiazile a VAME Project With the variables above, initialize a new project and save the path to the `config.yaml` file as `config`. This will create a new project folder with a predefined structure in your working_directory.<jupyter_code>config = vame.init_new_project(project=project, videos=videos, working_directory=working_directory, videotype='.mp4')<jupyter_output><empty_output><jupyter_text>Alternatively, you can open an existing VAME project by linking to the existing `config.yaml` file<jupyter_code>config = '/YOUR/WORKING/DIRECTORY/NewVAMEProject_20211201/config.yaml'<jupyter_output><empty_output><jupyter_text>Step 1.2: Get your data ready First, move your DeepLabCut `.csv` data to the corresponding `videos/pose_estimation/` directory. Then, use the function below to align your behavior videos egocentrically given `pose_ref_index` as a list of reference coordinate for alignment. In this case `[0,5]`. Example: 0: snout, 1: forehand_left, 2: forehand_right, 3: hindleft, 4: hindright, 5: tail<jupyter_code>vame.egocentric_alignment(config, pose_ref_index=[0,5])<jupyter_output><empty_output><jupyter_text>Alternatively, if your data is already egocentrically aligned, or you don't really believe that behavior should be studied egocentrically, transform your DeepLabCut `.csv` files to numpy arrays.<jupyter_code>vame.csv_to_numpy(config, datapath='C:\\Research\\VAME\\vame_alpha_release-Mar16-2021\\videos\\pose_estimation\\')<jupyter_output><empty_output><jupyter_text>Step 1.3: Create the Training Set<jupyter_code>vame.create_trainset(config)<jupyter_output><empty_output><jupyter_text>Step 2: Train your VAME Model<jupyter_code>vame.train_model(config)<jupyter_output><empty_output><jupyter_text>Step 3: Evaluate the model<jupyter_code>vame.evaluate_model(config)<jupyter_output><empty_output><jupyter_text>Step 4: Motif segmentation<jupyter_code>vame.pose_segmentation(config)<jupyter_output><empty_output><jupyter_text>Step 5: Create Motif Videos<jupyter_code>vame.motif_videos(config, videoType='.mp4')<jupyter_output><empty_output><jupyter_text>Step 6: Create behavioral hierarchies<jupyter_code>vame.community(config, show_umap=False, cut_tree=2)<jupyter_output><empty_output><jupyter_text>Step 7: Create community videos<jupyter_code>vame.community_videos(config)<jupyter_output><empty_output><jupyter_text>Step 8: Create UMAP visualization<jupyter_code>vame.visualization(config, label=None) #options: label: None, "motif", "community"<jupyter_output><empty_output><jupyter_text>Step 9: Create GIF Animation<jupyter_code># Note: This function is currently very slow. Once the frames are saved you can create a video
# or gif via e.g. ImageJ or other tools
vame.gif(config, pose_ref_index=[0,5], subtract_background=True, start=None, 
         length=500, max_lag=30, label='community', file_format='.mp4', crop_size=(300,300))<jupyter_output><empty_output><jupyter_text>Step 10: Create a generative model<jupyter_code>vame.generative_model(config, mode="centers") #options: mode: "sampling", "reconstruction", "centers", "motifs"<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1010597053502197, 'fraction_numerical': 0.019384853967433446, 'mean_word_length': 8.948586118251928, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 65, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '16', 'dir': 'jupyter-structured-clean-dedup', 'id': '82755', 'license': 'MIT', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1292, 'n_words': 299, 'path': 'docs/_build/jupyter_execute/Part1VAME.ipynb', 'repo_name': 'Guillermo-Hidalgo-Gadea/Seminar-ComputationalEthology', 'size': '3869'}