diff --git a/hfdocs/source/index.mdx b/hfdocs/source/index.mdx index 259170b5..fb7634b2 100644 --- a/hfdocs/source/index.mdx +++ b/hfdocs/source/index.mdx @@ -1,6 +1,4 @@ -# Getting Started - -## Welcome +# timm `timm` is a library containing SOTA computer vision models, layers, utilities, optimizers, schedulers, data-loaders, augmentations, and training/evaluation scripts. It provides high-level APIs for popular model architectures and standard datasets, as well as utilities for low-level model manipulation. diff --git a/hfdocs/source/installation.mdx b/hfdocs/source/installation.mdx index 2ae52518..1be87857 100644 --- a/hfdocs/source/installation.mdx +++ b/hfdocs/source/installation.mdx @@ -1,3 +1,75 @@ # Installation -TODO \ No newline at end of file +Before you start, you'll need to setup your environment and install the appropriate packages. `timm` is tested on **Python 3+**. + +## Virtual Environment + +You should install `timm` in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep things tidy and avoid dependency conflicts. + +1. Create and navigate to your project directory: + + ```bash + mkdir ~/my-project + cd ~/my-project + ``` + +2. Start a virtual environment inside your directory: + + ```bash + python -m venv .env + ``` + +3. Activate and deactivate the virtual environment with the following commands: + + ```bash + # Activate the virtual environment + source .env/bin/activate + + # Deactivate the virtual environment + source .env/bin/deactivate + ``` +` +Once you've created your virtual environment, you can install `timm` in it. + +## Using pip + +The most straightforward way to install `timm` is with pip: + +```bash +pip install timm +``` + +Alternatively, you can install `timm` from GitHub directly to get the latest, bleeding-edge version: + +```bash +pip install git+https://github.com/rwightman/pytorch-image-models.git +``` + +```bash +Run the following command to check if `timm` has been properly installed: + +```bash +python -c "from timm import list_models; print(list_models(pretrained=True)[:5])" +``` + +This command lists the first five pretrained models available in `timm` (which are sorted alphebetically). You should see the following output: + +```python +['adv_inception_v3', 'bat_resnext26ts', 'beit_base_patch16_224', 'beit_base_patch16_224_in22k', 'beit_base_patch16_384'] +``` + +## From Source + +Building `timm` from source lets you make changes to the code base. To install from the source, clone the repository and install with the following commands: + +```bash +git clone https://github.com/rwightman/timm.git +cd timm +pip install -e . +``` + +Again, you can check if `timm` was properly installed with the following command: + +```bash +python -c "from timm import list_models; print(list_models(pretrained=True)[:5])" +```