mohajeri
(peyman mohajerian)
January 11, 2021, 5:07am
1
How would you denoise an image prior to multi-classification problem similar to this in opencv: https://docs.opencv.org/3.4/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93
I know I can do this offline and save the images, I’m asking how it can be done as part of the pipeline?
You would create a transform something like this.
try this: https://gist.github.com/tcapelle/25adfa75eb99a5e249f7d78f5131b967
def permute_rows(img: Tensor, k=5):
"permute `k` rows on image or bathc of images"
out_img = img.clone()
n = img.shape[-2]
rows = L(random.choices(range_of(n), k=k))
idxs = rows.sorted()
out_img[..., idxs, :] = img[..., rows, :] #batch compatible
return out_img
and then as a Transform:
class RandPermute(Transform):
"Permute `k` rows on image, all batch identically"
def __init__(sel…
tcapelle
(Thomas)
January 13, 2021, 9:02am
3
Here you have a nice tuto on how to create your own Transform
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#hide\n",
"#skip\n",
"! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# hide\n",
This file has been truncated. show original
mohajeri
(peyman mohajerian)
January 15, 2021, 5:34am
4
Thanks all for the help, i added opencv but it slowed down my training by a lot. Now I found this interesting project https://github.com/cgnorthcutt/cleanlab will try to see if it works with fastai, i assume it will since the model is a pytorch.