### Load and Inspect utokyo_pr2_opening_fridge_converted_externally_to_rlds Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/utokyo_pr2_opening_fridge_converted_externally_to_rlds.md Loads the dataset and prints the first 4 examples. Ensure tensorflow_datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('utokyo_pr2_opening_fridge_converted_externally_to_rlds', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Load and Iterate Natural Questions Open Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/natural_questions_open.md This snippet shows how to load the 'natural_questions_open' dataset and iterate through its training split. It's a basic example for getting started with the dataset. ```python import tensorflow_datasets as tfds ds = tfds.load('natural_questions_open', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display Akuntsu (aqz_tudet) Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/universal_dependencies.md This snippet shows how to display examples for the universal_dependencies-aqz_tudet dataset using a button click to fetch and render the data. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/universal_dependencies-aqz_tudet-1.0.1.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Display wiki40b-sl Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wiki40b.md Loads and displays examples for the wiki40b-sl dataset configuration. This script fetches data from a URL and injects it into the DOM. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/wiki40b-sl-1.3.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Iterate through MSLR-WEB dataset examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/mslr_web.md Demonstrates how to load the MSLR-WEB dataset and iterate through a few examples. Ensure TensorFlow Datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('mslr_web', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Iterate Through Istella Dataset Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/istella.md Shows how to load the Istella dataset and iterate through a few examples. Ensure TensorFlow Datasets is installed and the dataset is available. ```python import tensorflow_datasets as tfds ds = tfds.load('istella', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display wiki40b-ro Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wiki40b.md Loads and displays examples for the wiki40b-ro dataset configuration. This script fetches data from a URL and injects it into the DOM. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/wiki40b-ro-1.3.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Display wiki40b-sk Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wiki40b.md Loads and displays examples for the wiki40b-sk dataset configuration. This script fetches data from a URL and injects it into the DOM. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/wiki40b-sk-1.3.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Install and Run Pylint for Code Formatting Source: https://github.com/tensorflow/datasets/blob/master/docs/contribute.md Use pylint to check code formatting according to the style guide. Ensure pylint is installed or upgrade it. ```sh pip install pylint --upgrade pylint tensorflow_datasets/core/some_file.py ``` -------------------------------- ### Display wiki40b-bg Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wiki40b.md Loads and displays examples for the wiki40b-bg dataset configuration. This script fetches HTML content from a specified URL and injects it into a div. It includes error handling for the fetch operation. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/wiki40b-bg-1.3.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Display robomimic_ph/can_ph_low_dim Examples as DataFrame Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/robomimic_ph.md This example demonstrates how to load and display the robomimic_ph/can_ph_low_dim dataset using tfds.as_dataframe. It requires the tfds library to be installed and the dataset to be downloaded. ```python import tensorflow_datasets as tfds # Load the dataset dataset = tfds.load('robomimic_ph/can_ph_low_dim', split='train', download=False) # Convert to pandas DataFrame df = tfds.as_dataframe(dataset) # Display the DataFrame (or a subset) print(df.head()) ``` -------------------------------- ### Display Universal Dependencies it_partut Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/universal_dependencies.md This snippet demonstrates how to display examples from the Universal Dependencies it_partut dataset using an interactive DataFrame. It fetches the data from a Google Cloud Storage URL and renders it in the browser. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/universal_dependencies-it_partut-1.0.1.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Get Imagenet Dataset Shard and Example Counts Source: https://github.com/tensorflow/datasets/blob/master/docs/determinism.ipynb Retrieves the number of shards and total examples for the 'train' split of the ImageNet dataset. This helps understand the dataset's structure. ```python import re import tensorflow_datasets as tfds imagenet = tfds.builder('imagenet2012') num_shards = imagenet.info.splits['train'].num_shards num_examples = imagenet.info.splits['train'].num_examples print(f'imagenet has {num_shards} shards ({num_examples} examples)') ``` -------------------------------- ### Load utaustin_mutex Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/utaustin_mutex.md Load the utaustin_mutex dataset and iterate over a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('utaustin_mutex', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Install Protobuf Compiler Source: https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/core/proto/README.md Run this script to install the necessary protocol buffer compiler. This is a prerequisite for regenerating Python files. ```bash ./install_protoc.sh ``` -------------------------------- ### Load the300w_lp Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/the300w_lp.md Load the the300w_lp dataset and iterate over a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('the300w_lp', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display CFQ-cd0_r3 Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/cfq.md This snippet allows users to display examples from the cfq-cd0_r3 dataset. It fetches an HTML file containing the dataset's examples and renders it in the browser. Click the button to load the data. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/cfq-cd0_r3-1.2.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load robomimic_mh Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/robomimic_mh.md Loads the robomimic_mh dataset and iterates through a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('robomimic_mh', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display CFQ-cd0_r2 Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/cfq.md This snippet allows users to display examples from the cfq-cd0_r2 dataset. It fetches an HTML file containing the dataset's examples and renders it in the browser. Click the button to load the data. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/cfq-cd0_r2-1.2.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load and iterate over the dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/open_images_challenge2019_detection.md Load the open_images_challenge2019_detection dataset and iterate over a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('open_images_challenge2019_detection', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Load Wikihow 'all' Dataset Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wikihow.md JavaScript code to dynamically load and display example data for the Wikihow 'all' dataset from a remote URL. It includes error handling for the fetch request. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/wikihow-all-1.2.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Display SUN397 Dataset Examples (Standard Part 1 Config) Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/sun397.md Loads and displays examples from the SUN397 standard-part1-120k configuration using a button click. This allows for interactive exploration of this specific dataset partition. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/sun397-standard-part1-120k-4.0.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load glove100_angular Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/glove100_angular.md Load the glove100_angular dataset and iterate through a few examples. Ensure tensorflow_datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('glove100_angular', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Load and Iterate over wikihow Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wikihow.md Loads the wikihow dataset and iterates over the first few examples. Ensure the dataset is downloaded and placed in the manual directory as per instructions. ```python import tensorflow_datasets as tfds ds = tfds.load('wikihow', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Load eth_agent_affordances Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/eth_agent_affordances.md Load the eth_agent_affordances dataset and iterate through a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('eth_agent_affordances', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display Universal Dependencies nl_lassysmall Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/universal_dependencies.md This script fetches and displays examples from the nl_lassysmall Universal Dependencies dataset. It uses a button to trigger the loading of the data from a remote URL and displays it within a div. Error handling is included for the fetch operation. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/universal_dependencies-nl_lassysmall-1.0.1.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load efron_morris75 Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/efron_morris75.md Load the efron_morris75 dataset and iterate over a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('efron_morris75', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Load WIT Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wit.md Loads the WIT dataset and iterates through the first few examples. Ensure tensorflow_datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('wit', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display unified_qa/winogrande_m Dataset Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/unified_qa.md This snippet demonstrates how to display examples from the unified_qa/winogrande_m dataset using a JavaScript function that fetches and renders an HTML table. It includes error handling for the fetch operation. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/unified_qa-winogrande_m-1.0.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open '; + 'a new issue.'; } }); ``` -------------------------------- ### Display CFQ-cd0_r4 Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/cfq.md This snippet allows users to display examples from the cfq-cd0_r4 dataset. It fetches an HTML file containing the dataset's examples and renders it in the browser. Click the button to load the data. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/cfq-cd0_r4-1.2.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load wake_vision Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wake_vision.md Load the wake_vision dataset for training and iterate through a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('wake_vision', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display star_cfq/single_pool_5x_b_cfq Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/star_cfq.md Loads and displays examples for the star_cfq/single_pool_5x_b_cfq dataset configuration. This script fetches an HTML file containing the dataset's examples and injects it into the page. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/star_cfq-single_pool_5x_b_cfq-1.1.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load and Iterate VoxCeleb Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/voxceleb.md Load the VoxCeleb dataset and iterate through a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('voxceleb', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display wiki40b-ca Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/wiki40b.md Loads and displays examples for the wiki40b-ca dataset configuration. This script fetches HTML content from a specified URL and injects it into a div. It includes error handling for the fetch operation. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/wiki40b-ca-1.3.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load utokyo_xarm_pick_and_place_converted_externally_to_rlds Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/utokyo_xarm_pick_and_place_converted_externally_to_rlds.md Load the dataset and take the first 4 examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('utokyo_xarm_pick_and_place_converted_externally_to_rlds', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display Universal Dependencies HBO PTNK Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/universal_dependencies.md This snippet displays interactive examples for the universal_dependencies/hbo_ptnk dataset. It fetches and renders an HTML dataframe upon button click. Ensure the button is only clicked once as the dataframe is loaded only once. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/universal_dependencies-hbo_ptnk-1.0.1.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load taco_play Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/taco_play.md Load the taco_play dataset for training and iterate through a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('taco_play', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Load robomimic_ph Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/robomimic_ph.md Loads the robomimic_ph dataset and iterates through the first few examples. Ensure tensorflow_datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('robomimic_ph', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display star_cfq/single_pool_6x_b_cfq Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/star_cfq.md Loads and displays examples for the star_cfq/single_pool_6x_b_cfq dataset configuration. This script fetches an HTML file containing the dataset's examples and injects it into the page. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/star_cfq-single_pool_6x_b_cfq-1.1.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load scene_parse150 Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/scene_parse150.md Loads the scene_parse150 dataset for training and iterates through a few examples. Ensure you have tensorflow_datasets installed. ```python import tensorflow_datasets as tfds ds = tfds.load('scene_parse150', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display QQP Dataset Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/glue.md Provides an interactive way to display examples from the Quora Question Pairs dataset. This script fetches and renders the example data from a specified URL. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/glue-qqp-2.0.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load and Iterate plex_robosuite Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/plex_robosuite.md Loads the plex_robosuite dataset and iterates through a few examples. Ensure tensorflow_datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('plex_robosuite', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display SUN397 Dataset Examples (standard-part5-120k) Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/sun397.md This snippet allows users to display examples from the SUN397 dataset's standard-part5-120k configuration. It fetches and renders an HTML file containing the dataset examples upon a button click. Includes error handling for the fetch operation. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/sun397-standard-part5-120k-4.0.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ``` -------------------------------- ### Load mnist_corrupted Dataset Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/mnist_corrupted.md Loads the mnist_corrupted dataset and iterates through the first few examples. Ensure tensorflow_datasets is installed. ```python import tensorflow_datasets as tfds ds = tfds.load('mnist_corrupted', split='train') for ex in ds.take(4): print(ex) ``` -------------------------------- ### Display star_cfq/single_pool_4x_b_cfq Examples Source: https://github.com/tensorflow/datasets/blob/master/docs/catalog/star_cfq.md Loads and displays examples for the star_cfq/single_pool_4x_b_cfq dataset configuration. This script fetches an HTML file containing the dataset's examples and injects it into the page. ```javascript const url = "https://storage.googleapis.com/tfds-data/visualization/dataframe/star_cfq-single_pool_4x_b_cfq-1.1.0.html"; const dataButton = document.getElementById('displaydataframe'); dataButton.addEventListener('click', async () => { // Disable the button after clicking (dataframe loaded only once). dataButton.disabled = true; const contentPane = document.getElementById('dataframecontent'); try { const response = await fetch(url); // Error response codes don't throw an error, so force an error to show // the error message. if (!response.ok) throw Error(response.statusText); const data = await response.text(); contentPane.innerHTML = data; } catch (e) { contentPane.innerHTML = 'Error loading examples. If the error persist, please open ' + 'a new issue.'; } }); ```