Fix gamma error
Browse files- README.md +3 -3
- config.json +1 -1
- histaug_model.py +5 -5
- model.safetensors +2 -2
README.md
CHANGED
|
@@ -72,7 +72,7 @@ The original transform configuration (shipped in the model config) is:
|
|
| 72 |
"crop": 0.75,
|
| 73 |
"dilation": 0.75,
|
| 74 |
"erosion": 0.75,
|
| 75 |
-
"
|
| 76 |
"gaussian_blur": 0.75,
|
| 77 |
"h_flip": 0.75,
|
| 78 |
"hed": [-0.5, 0.5],
|
|
@@ -85,7 +85,7 @@ The original transform configuration (shipped in the model config) is:
|
|
| 85 |
}
|
| 86 |
```
|
| 87 |
|
| 88 |
-
* **Continuous transforms** (e.g., `brightness`, `hue`, `hed`, `
|
| 89 |
* **Discrete/binary transforms** (e.g., `h_flip`, `v_flip`, `dilation`, `erosion`, `rotation`, `gaussian_blur`, `crop`) use a **probability** (e.g., `0.75`) indicating how likely the transform is applied during sampling.
|
| 90 |
|
| 91 |
> You can access and modify this at runtime via:
|
|
@@ -233,7 +233,7 @@ Then in your offline job/script:
|
|
| 233 |
|
| 234 |
```python
|
| 235 |
from transformers import AutoModel
|
| 236 |
-
|
| 237 |
"./histaug-conch_v15", # local path instead of hub ID
|
| 238 |
trust_remote_code=True,
|
| 239 |
local_files_only=True, # uses local files only
|
|
|
|
| 72 |
"crop": 0.75,
|
| 73 |
"dilation": 0.75,
|
| 74 |
"erosion": 0.75,
|
| 75 |
+
"powerlaw": [-0.5, 0.5],
|
| 76 |
"gaussian_blur": 0.75,
|
| 77 |
"h_flip": 0.75,
|
| 78 |
"hed": [-0.5, 0.5],
|
|
|
|
| 85 |
}
|
| 86 |
```
|
| 87 |
|
| 88 |
+
* **Continuous transforms** (e.g., `brightness`, `hue`, `hed`, `powerlaw`, `saturation`) use an **interval** `[min, max]` from which parameters are sampled.
|
| 89 |
* **Discrete/binary transforms** (e.g., `h_flip`, `v_flip`, `dilation`, `erosion`, `rotation`, `gaussian_blur`, `crop`) use a **probability** (e.g., `0.75`) indicating how likely the transform is applied during sampling.
|
| 90 |
|
| 91 |
> You can access and modify this at runtime via:
|
|
|
|
| 233 |
|
| 234 |
```python
|
| 235 |
from transformers import AutoModel
|
| 236 |
+
model = AutoModel.from_pretrained(
|
| 237 |
"./histaug-conch_v15", # local path instead of hub ID
|
| 238 |
trust_remote_code=True,
|
| 239 |
local_files_only=True, # uses local files only
|
config.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
| 28 |
"crop": 0.75,
|
| 29 |
"dilation": 0.75,
|
| 30 |
"erosion": 0.75,
|
| 31 |
-
"
|
| 32 |
-0.5,
|
| 33 |
0.5
|
| 34 |
],
|
|
|
|
| 28 |
"crop": 0.75,
|
| 29 |
"dilation": 0.75,
|
| 30 |
"erosion": 0.75,
|
| 31 |
+
"powerlaw": [
|
| 32 |
-0.5,
|
| 33 |
0.5
|
| 34 |
],
|
histaug_model.py
CHANGED
|
@@ -317,7 +317,7 @@ class HistaugModel(nn.Module):
|
|
| 317 |
"saturation",
|
| 318 |
"hed",
|
| 319 |
"hue",
|
| 320 |
-
"
|
| 321 |
]:
|
| 322 |
# Continuous transformations
|
| 323 |
transform_embeddings[aug_name] = nn.Sequential(
|
|
@@ -355,7 +355,7 @@ class HistaugModel(nn.Module):
|
|
| 355 |
"contrast",
|
| 356 |
"saturation",
|
| 357 |
"hue",
|
| 358 |
-
"
|
| 359 |
"hed",
|
| 360 |
]:
|
| 361 |
z_transform = self.transform_embeddings[aug_name](
|
|
@@ -414,7 +414,7 @@ class HistaugModel(nn.Module):
|
|
| 414 |
"contrast",
|
| 415 |
"saturation",
|
| 416 |
"hue",
|
| 417 |
-
"
|
| 418 |
"hed",
|
| 419 |
]
|
| 420 |
|
|
@@ -509,7 +509,7 @@ class HistaugModel(nn.Module):
|
|
| 509 |
"contrast",
|
| 510 |
"saturation",
|
| 511 |
"hue",
|
| 512 |
-
"
|
| 513 |
"hed",
|
| 514 |
):
|
| 515 |
lower_bound, upper_bound = map(float, config)
|
|
@@ -566,4 +566,4 @@ class HistaugModel(nn.Module):
|
|
| 566 |
x = x.view(x.shape[0], 1, -1)
|
| 567 |
x = self.head(x)
|
| 568 |
x = x[:, 0, :]
|
| 569 |
-
return x
|
|
|
|
| 317 |
"saturation",
|
| 318 |
"hed",
|
| 319 |
"hue",
|
| 320 |
+
"powerlaw",
|
| 321 |
]:
|
| 322 |
# Continuous transformations
|
| 323 |
transform_embeddings[aug_name] = nn.Sequential(
|
|
|
|
| 355 |
"contrast",
|
| 356 |
"saturation",
|
| 357 |
"hue",
|
| 358 |
+
"powerlaw",
|
| 359 |
"hed",
|
| 360 |
]:
|
| 361 |
z_transform = self.transform_embeddings[aug_name](
|
|
|
|
| 414 |
"contrast",
|
| 415 |
"saturation",
|
| 416 |
"hue",
|
| 417 |
+
"powerlaw",
|
| 418 |
"hed",
|
| 419 |
]
|
| 420 |
|
|
|
|
| 509 |
"contrast",
|
| 510 |
"saturation",
|
| 511 |
"hue",
|
| 512 |
+
"powerlaw",
|
| 513 |
"hed",
|
| 514 |
):
|
| 515 |
lower_bound, upper_bound = map(float, config)
|
|
|
|
| 566 |
x = x.view(x.shape[0], 1, -1)
|
| 567 |
x = self.head(x)
|
| 568 |
x = x[:, 0, :]
|
| 569 |
+
return x
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f09dd64a7c30dd3fae745c0c645cb3efd2ea69386618745d6d0bd2f4375025e8
|
| 3 |
+
size 13111616
|