https://github.com/lukashedegaard/office31
Splits for Office31 domain adaptation tasks
https://github.com/lukashedegaard/office31
Last synced: 2 months ago
JSON representation
Splits for Office31 domain adaptation tasks
- Host: GitHub
- URL: https://github.com/lukashedegaard/office31
- Owner: LukasHedegaard
- License: mit
- Created: 2020-04-13T16:14:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T12:11:48.000Z (about 4 years ago)
- Last Synced: 2025-02-07T18:17:38.737Z (3 months ago)
- Language: Python
- Homepage: https://pypi.org/project/office31/
- Size: 9.77 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Splits for Office31 domain adaptation tasks
This repository contains the revised protocol for creating Office31 splits for few shot domain adaptation.
Contrary to the usual splits, we define an independent test split here (split using a hardcoded seed), and let the train-val split vary according to a user-defined random seed.
## Installation
```bash
pip install office31
```## Usage
Getting the splits is a simple as:```python
from office31 import office31train, val, test = office31(
source_name = "webcam",
target_name = "amazon",
seed=1,
same_to_diff_class_ratio=3,
image_resize=(240, 240),
group_in_out=True, # groups data: ((img_s, img_t), (lbl_s, _lbl_t))
framework_conversion="tensorflow",
office_path = None, #automatically downloads to "~/data"
)
```The function automatically downloads and unpacks the data if necessary. It then creates the splits using the [Dataset Ops library](https://github.com/LukasHedegaard/datasetops).
Depending on your choice of machine learning library, the dataset can be converted to Tensorflow or PyTorch (assuming either is pre-installed) using Dataset Ops.