Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update degradations.py #667

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion basicsr/data/degradations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import torch
from scipy import special
from scipy.stats import multivariate_normal
from torchvision.transforms.functional_tensor import rgb_to_grayscale
from torchvision.transforms.functional import rgb_to_grayscale

# -------------------------------------------------------------------- #
# --------------------------- blur kernels --------------------------- #
Expand Down
157 changes: 157 additions & 0 deletions r-bot.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<mxfile host="app.diagrams.net" modified="2024-07-21T04:16:18.607Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" etag="PzYkzd3wClXmbfkY0jCn" version="24.7.2" type="github">
<diagram name="Page-1" id="kaDvxghzX0mULwTv-LZ7">
<mxGraphModel dx="1050" dy="1005" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="1">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="uk2FloNmh11kyuh5neVs-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="170" y="130" as="sourcePoint" />
<mxPoint x="240" y="270" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="uk2FloNmh11kyuh5neVs-1" target="uk2FloNmh11kyuh5neVs-6" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="330" y="130" />
<mxPoint x="330" y="200" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="uk2FloNmh11kyuh5neVs-1" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="240" y="60" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="uk2FloNmh11kyuh5neVs-1" target="uk2FloNmh11kyuh5neVs-35" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-1" value="Query" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="90" y="100" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-3" value="Business&lt;div&gt;Meta data&lt;/div&gt;" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="250" y="20" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-45" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="uk2FloNmh11kyuh5neVs-4" target="uk2FloNmh11kyuh5neVs-15" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-4" value="Fintuned LLM" style="image;aspect=fixed;html=1;points=[];align=center;fontSize=12;image=img/lib/azure2/ai_machine_learning/Bot_Services.svg;" parent="1" vertex="1">
<mxGeometry x="418" y="50" width="72" height="72" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="uk2FloNmh11kyuh5neVs-5" target="uk2FloNmh11kyuh5neVs-6" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-5" value="Business Images" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" parent="1" vertex="1">
<mxGeometry x="250" y="250" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-47" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=-0.055;entryY=0.926;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="uk2FloNmh11kyuh5neVs-6" target="uk2FloNmh11kyuh5neVs-15" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="550" y="150" as="targetPoint" />
<Array as="points">
<mxPoint x="457" y="160" />
<mxPoint x="550" y="160" />
<mxPoint x="550" y="171" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-6" value="&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;Personalized Images" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#ffffff;fillColor=#232F3E;dashed=0;verticalLabelPosition=middle;verticalAlign=bottom;align=center;html=1;whiteSpace=wrap;fontSize=10;fontStyle=1;spacing=3;shape=mxgraph.aws4.productIcon;prIcon=mxgraph.aws4.rekognition_image;" parent="1" vertex="1">
<mxGeometry x="424" y="175.4" width="66" height="90" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="uk2FloNmh11kyuh5neVs-1" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="410" y="90" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=-0.029;entryY=0.49;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="uk2FloNmh11kyuh5neVs-3" target="uk2FloNmh11kyuh5neVs-4" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-15" value="UI" style="verticalLabelPosition=bottom;aspect=fixed;html=1;shape=mxgraph.salesforce.web;" parent="1" vertex="1">
<mxGeometry x="610" y="70" width="72.66" height="57.4" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-16" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
<mxGeometry x="40" y="100" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-36" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="uk2FloNmh11kyuh5neVs-35" target="uk2FloNmh11kyuh5neVs-4" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-35" value="User reviews" style="swimlane;" parent="1" vertex="1" collapsed="1">
<mxGeometry x="390" y="-80" width="110" height="40" as="geometry">
<mxRectangle x="390" y="-80" width="80" height="70" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-48" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="576" y="189" width="206" height="181" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-49" value="" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" parent="1" vertex="1">
<mxGeometry x="600" y="230" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-50" value="&lt;font style=&quot;font-size: 10px;&quot;&gt;Text-Image Similarity Search with&lt;br&gt;CLIP&#39;s features&lt;/font&gt;" style="whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1">
<mxGeometry x="660" y="208" width="105" height="62" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-51" value="" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="600" y="275" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="uk2FloNmh11kyuh5neVs-52" value="&lt;font style=&quot;font-size: 10px;&quot;&gt;Sentence Transformer&#39;s text features&lt;/font&gt;" style="whiteSpace=wrap;html=1;align=center;" parent="1" vertex="1">
<mxGeometry x="660" y="275" width="107" height="55" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-1" value="Chroma DB" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="583" y="328" width="70" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-2" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="580" y="-100" width="340" height="130" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-3" value="" style="image;aspect=fixed;html=1;points=[];align=center;fontSize=12;image=img/lib/azure2/ai_machine_learning/Bot_Services.svg;" vertex="1" parent="1">
<mxGeometry x="587.66" y="-90" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-6" value="" style="sketch=0;pointerEvents=1;shadow=0;dashed=0;html=1;strokeColor=none;fillColor=#505050;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;outlineConnect=0;align=center;shape=mxgraph.office.concepts.document_blank;" vertex="1" parent="1">
<mxGeometry x="600" width="20" height="27" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-10" value="" style="sketch=0;pointerEvents=1;shadow=0;dashed=0;html=1;strokeColor=none;fillColor=#505050;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;outlineConnect=0;align=center;shape=mxgraph.office.concepts.document_blank;" vertex="1" parent="1">
<mxGeometry x="650" y="-1" width="20" height="27" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-13" value="" style="shadow=0;dashed=0;html=1;strokeColor=none;fillColor=#4495D1;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;align=center;outlineConnect=0;shape=mxgraph.veeam.checked_doc;" vertex="1" parent="1">
<mxGeometry x="753.88" y="-3.3000000000000007" width="30" height="31.6" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-18" value="" style="editableCssRules=.*;html=1;shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image=data:image/svg+xml,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnY9Imh0dHBzOi8vdmVjdGEuaW8vbmFubyIgd2lkdGg9IjIwLjAwMTA0NTIyNzA1MDc4IiBoZWlnaHQ9IjIwLjAwMTA0NTIyNzA1MDc4IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCAyMC4wMDEwNDUyMjcwNTA3OCAyMC4wMDEwNDUyMjcwNTA3OCI+JiN4YTsJPHN0eWxlIHR5cGU9InRleHQvY3NzIj4mI3hhOwkuc3Qwe2ZpbGw6I2FlY2JmYTt9JiN4YTsJLnN0MXtmaWxsOiM2NjlkZjY7fSYjeGE7CS5zdDJ7ZmlsbDojNDI4NWY0O30mI3hhOwk8L3N0eWxlPiYjeGE7CTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00LjczIDguODN2Mi42M2E0LjkxIDQuOTEgMCAwIDAgMS43MSAxLjc0VjguODN6Ii8+JiN4YTsJPHBhdGggY2xhc3M9InN0MSIgZD0iTTcuODkgNi40MXY3LjUzQTcuNjIgNy42MiAwIDAgMCA5IDE0YTggOCAwIDAgMCAxIDBWNi40MXoiLz4mI3hhOwk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTEuNjQgOS44NnYzLjI5YTUgNSAwIDAgMCAxLjctMS44MlY5Ljg2eiIvPiYjeGE7CTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xNS43NCAxNC4zMmwtMS40MiAxLjQyYS40Mi40MiAwIDAgMCAwIC42bDMuNTQgMy41NGEuNDIuNDIgMCAwIDAgLjU5IDBsMS40My0xLjQzYS40Mi40MiAwIDAgMCAwLS41OWwtMy41NC0zLjU0YS40Mi40MiAwIDAgMC0uNiAwIi8+JiN4YTsJPHBhdGggY2xhc3M9InN0MSIgZD0iTTkgMGE5IDkgMCAxIDAgMCAxOEE5IDkgMCAxIDAgOSAwbTAgMTUuNjlhNi42OCA2LjY4IDAgMCAxIC4wMDctMTMuMzYgNi42OCA2LjY4IDAgMCAxIDQuNzI3IDExLjQwM0E2LjY4IDYuNjggMCAwIDEgOSAxNS42OSIvPiYjeGE7PC9zdmc+;" vertex="1" parent="1">
<mxGeometry x="798.88" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-20" value="Tacobell" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="580" y="-40" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-21" value="KFC" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="730" y="-40" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-22" value="Subway" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="628" y="-40" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-23" value="Domino&#39;s" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="680" y="-40" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-25" value="KFC opening time?" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="783.88" y="-40" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-26" value="" style="verticalLabelPosition=bottom;aspect=fixed;html=1;shape=mxgraph.salesforce.bots;" vertex="1" parent="1">
<mxGeometry x="850" y="-36" width="60" height="57" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-27" value="" style="sketch=0;pointerEvents=1;shadow=0;dashed=0;html=1;strokeColor=none;fillColor=#505050;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;outlineConnect=0;align=center;shape=mxgraph.office.concepts.document_blank;" vertex="1" parent="1">
<mxGeometry x="688" y="-1" width="20" height="27" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-28" value="" style="shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image=https://cdn4.iconfinder.com/data/icons/essentials-72/24/039_-_Cross-128.png" vertex="1" parent="1">
<mxGeometry x="653" y="9" width="17" height="17" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-29" value="" style="shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image=https://cdn4.iconfinder.com/data/icons/essentials-72/24/039_-_Cross-128.png" vertex="1" parent="1">
<mxGeometry x="689.5" y="9" width="17" height="17" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-30" value="" style="shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image=https://cdn4.iconfinder.com/data/icons/essentials-72/24/039_-_Cross-128.png" vertex="1" parent="1">
<mxGeometry x="601.5" y="10" width="17" height="17" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-31" value="" style="verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;dashed=0;strokeWidth=1;shape=mxgraph.ios.iAddIcon;fillColor=#7AdF78;fillColor2=#1A9917;strokeColor=#ffffff;sketch=0;" vertex="1" parent="1">
<mxGeometry x="725" y="6" width="15" height="15" as="geometry" />
</mxCell>
<mxCell id="5Ty_rDfWxCvQlMKUGbTs-33" value="Train RAFT" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="810" y="-90" width="90" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>