Update README.md
Browse files
README.md
CHANGED
|
@@ -4,3 +4,14 @@ tags: []
|
|
| 4 |
---
|
| 5 |
|
| 6 |
This is a data processor for the Community Forensics classifiers. Detailed instructions will be updated at the [Community Forensics GitHub_repo](https://github.com/JeongsooP/Community-Forensics) in the future.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
This is a data processor for the Community Forensics classifiers. Detailed instructions will be updated at the [Community Forensics GitHub_repo](https://github.com/JeongsooP/Community-Forensics) in the future.
|
| 7 |
+
|
| 8 |
+
### Simple usage example.
|
| 9 |
+
`dataprocessor_hf.py` is included in this repository.
|
| 10 |
+
```python
|
| 11 |
+
import dataprocessor_hf as dphf
|
| 12 |
+
from PIL import Image
|
| 13 |
+
data_processor = dphf.CommForImageProcessor.from_pretrained('OwensLab/commfor-data-preprocessor', size=384)
|
| 14 |
+
img = Image.open('path_to_img.png')
|
| 15 |
+
processed_image = data_processor(img, mode='test')
|
| 16 |
+
|
| 17 |
+
```
|