semvec/pypi-packages huggingface dataset:
udata-schema-gouvfr 1.3.2
Integration with schema.data.gouv.fr
License: MIT
Keywords: udata,schema,tableschema

# udata-schema-gouvfr

This udata plugin provides an integration with [schema.data.gouv.fr](https://schema.data.gouv.fr)

## Features

- Adds a schema button to resources with a schema
- Displays a modal when clicking this button providing links to documentation and validation


## Usage

Install the plugin package in your udata environment:

```bash
pip install udata-schema-gouvfr
```

Then activate it in your `udata.cfg`:

```python
PLUGINS = ['schema-gouvfr']
```

## Configuration

You can control this plugin behavior with the following `udata.cfg` parameters:

- **`SCHEMA_GOUVFR_VALIDATA_URL`**: the URL to your [Validata](https://validata.fr/) instance (without trailing slash). **ex:** `https://validata.etalab.studio`
- **`SCHEMA_GOUVFR_IRVE_STABLE_RESOURCE_URL`**: the permalink to the consolidated [IRVE dataset](irve-dataset)'s latest resource. **ex:** `https://www.data.gouv.fr/fr/datasets/r/50625621-18bd-43cb-8fde-6b8c24bdabb3`

## Jobs

This plugin declares jobs.

- **`udata job run set-irve-schemas`**: sets the `schema` attribute of resources that are consolidated as part of [the national IRVE dataset](irve-dataset)


[irve-dataset]: https://www.data.gouv.fr/fr/datasets/fichier-consolide-des-bornes-de-recharge-pour-vehicules-electriques/

# Changelog

## 1.3.2 (2021-05-28)

- Fix links in modal (Validata and data.gouv facet)
- Fix to function which detect if resource has schema or not

## 1.3.1 (2021-05-25)

- Add venv's activation in circle's configuration file for publish step [#8](https://github.com/etalab/udata-schema-gouvfr/pull/8)

## 1.3.0 (2021-05-25)

- Add version schema if exists in modal [#7](https://github.com/etalab/udata-schema-gouvfr/pull/7)

## 1.2.0 (2020-10-16)

- Link to datasets with the same schema from the schema modal [#4](https://github.com/etalab/udata-schema-gouvfr/pull/4)

## 1.1.0 (2020-08-25)

- Add a job to set the `schema` attribute to the IRVE schema on multiple resources [#3](https://github.com/etalab/udata-schema-gouvfr/pull/3)

## 1.0.0 (2020-08-05)

Initial release
fastapi-resource-server 0.1.2
Build resource servers with FastAPI
License: MIT
Requires Python: >=3.6.2,<4.0.0
Keywords: fastapi,authentication,oidc,openidconnect

# FastAPI Resource Server

Build an OIDC resource server using FastAPI.

Your aplication receives the claims decoded from the access token.

# Usage

Run keycloak on port 8888:

```sh
docker container run --name auth-server -d -p 8888:8080 \
    -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin \
    jboss/keycloak:latest
```

Install dependencies

```sh
pip install fastapi fastapi_resource_server uvicorn
```

Create the main.py module

```python
from fastapi import Depends, FastAPI, Security
from pydantic import BaseModel

from fastapi_resource_server import JwtDecodeOptions, OidcResourceServer

app = FastAPI()

decode_options = JwtDecodeOptions(verify_aud=False)

auth_scheme = OidcResourceServer(
    "http://localhost:8888/auth/realms/master",
    scheme_name="Keycloak",
    jwt_decode_options=decode_options,
)


class User(BaseModel):
    username: str
    given_name: str
    family_name: str
    email: str


def get_current_user(claims: dict = Security(auth_scheme)):
    claims.update(username=claims["preferred_username"])
    user = User.parse_obj(claims)
    return user


@app.get("/users/me")
def read_current_user(current_user: User = Depends(get_current_user)):
    return current_user
```

Run the application

```sh
uvicorn main:app
```
slakh-dataset 0.1.25
Unofficial PyTorch dataset for Slakh
License: MIT
Requires Python: >=3.7,<4.0

# Slakh PyTorch Dataset

Unofficial PyTorch dataset for [Slakh](http://www.slakh.com/).

This project is a work in progress, expect breaking changes!

## Roadmap

### Automatic music transcription (AMT) usecase with audio and labels

- [x] Specify dataset split (`original`, `splits_v2`, `redux`)
- [x] Add new splits (`redux_no_pitch_bend`, ...) (Should also be filed upstream) (implemented by `skip_pitch_bend_tracks`)
- [x] Load audio `mix.flac` (all the instruments comined)
- [x] Load individual audio mixes (need to combine audio in a streaming fashion)
- [x] Specify `train`, `validation` or `test` group
- [x] Choose sequence length
- [x] Reproducable load sequences (usefull for validation group to get consistent results)
- [ ] Add more instruments (`eletric-bass`, `piano`, `guitar`, ...)
- [x] Choose between having audio in memory or stream from disk (solved by `max_files_in_memory`)
- [x] Add to pip

### Audio source separation usecase with different audio mixes
- [ ] List to come


## Usage

1. Download the Slakh dataset (see the official [website](http://www.slakh.com/)). It's about 100GB compressed so expect using some time on this point.

2. Install the Python package with pip:
```bash
pip install slakh-dataset
```

3. Convert the audio to 16 kHz (see https://github.com/ethman/slakh-utils)

4. You can use the dataset (AMT usecase):

```python
from torch.utils.data import DataLoader
from slakh_dataset import SlakhAmtDataset


dataset = SlakhAmtDataset(
    path='path/to/slakh-16khz-folder'
    split='redux', # 'splits_v2','redux-no-pitch-bend'
    audio='mix.flac', # 'individual'
    label_instruments='electric-bass', # or `label_midi_programs`
    # label_midi_programs=[33, 34, 35, 36, 37],
    groups=['train'],
    skip_pitch_bend_tracks=True,
    sequence_length=327680,
    max_files_in_memory=200,
)

batch_size = 8
loader = DataLoader(dataset, batch_size, shuffle=True, drop_last=True)

# train model on dataset...
```

## Acknowledgement

- This code is based on the dataset in [Onset and Frames](https://github.com/jongwook/onsets-and-frames) by Jong Wook Kim which is MIT Lisenced.

- Slakh http://www.slakh.com/
mlp-mixer 0.0.1
Pytorch implementation of MLPMixer
License: MIT
Requires Python: >3.6
Keywords: deep learning,image classification

# MLP Mixer Pytorch

Pytorch implementation of [MLP-Mixer](https://arxiv.org/abs/2105.01601).

<img src="https://miro.medium.com/max/2400/1*DqrznEKzR_xB-CEhpOav3A.png" />


## Sample usage

```console
foo@bar:❯ pip install mlp_mixer
```

```Python
from mlp_mixer import MLPMixer

model = MLPMixer(
        img_size=IMG_SZ,
        img_channels=IMG_CHANNELS,
        num_classes=NUM_CLASSES,
        mixer_depth=DEPTH,
        num_patches=NUM_PATCHES,
        num_channels=NUM_CHANNELS,
        expansion=EXPANSION,
        dropout=DROPOUT,
    )
```


## Citations

```bibtex
    @misc{tolstikhin2021mlpmixer,
        title   = {MLP-Mixer: An all-MLP Architecture for Vision},
        author  = {Ilya Tolstikhin and Neil Houlsby and Alexander Kolesnikov and Lucas Beyer and Xiaohua Zhai and Thomas Unterthiner and Jessica Yung and Daniel Keysers and Jakob Uszkoreit and Mario Lucic and Alexey Dosovitskiy},
        year    = {2021},
        eprint  = {2105.01601},
        archivePrefix = {arXiv},
        primaryClass = {cs.CV}
    }
```