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

Fix image urls #1957

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
},
"outputs": [],
"source": [
"!!pip install -Uq keras\n",
"!!pip install -Uq git+https://github.com/keras-team/keras-hub.git\n",
"!!wget --user-agent=\"User-Agent: Mozilla/5.0\" -O mountain_dog.png https://i.imgur.com/3AHYG9Z.png\n",
"!!wget --user-agent=\"User-Agent: Mozilla/5.0\" -O mountain_dog_mask.png https://i.imgur.com/n3Prpj6.png"
"!pip install -Uq keras\n",
"!pip install -Uq git+https://github.com/keras-team/keras-hub.git\n",
"!wget --user-agent=\"User-Agent: Mozilla/5.0\" -O mountain_dog.png https://i.imgur.com/3AHYG9Z.png\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of getting images from imgur isn't too great. How about... pushing the images to the keras.io repo (in an examples/assets/ folder or something like that) and linking them from github?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Will fix it in another PR!

"!wget --user-agent=\"User-Agent: Mozilla/5.0\" -O mountain_dog_mask.png https://i.imgur.com/n3Prpj6.png"
]
},
{
Expand Down
16 changes: 8 additions & 8 deletions guides/md/keras_hub/segment_anything_in_keras_hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ plt.show()



![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_11_0.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_11_0.png)



Expand All @@ -262,7 +262,7 @@ plt.show()



![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_13_0.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_13_0.png)



Expand Down Expand Up @@ -326,7 +326,7 @@ plt.show()



![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_17_0.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_17_0.png)



Expand Down Expand Up @@ -354,7 +354,7 @@ plt.show()



![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_20_0.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_20_0.png)



Expand Down Expand Up @@ -395,7 +395,7 @@ plt.show()
```
</div>

![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_23_1.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_23_1.png)



Expand Down Expand Up @@ -442,7 +442,7 @@ plt.show()
```
</div>

![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_25_1.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_25_1.png)



Expand Down Expand Up @@ -625,7 +625,7 @@ WARNING:matplotlib.image:Clipping input data to the valid range for imshow with
```
</div>

![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_31_2.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_31_2.png)



Expand Down Expand Up @@ -690,7 +690,7 @@ WARNING:matplotlib.image:Clipping input data to the valid range for imshow with
```
</div>

![png](/content/keras-io/guides/img/segment_anything_in_keras_hub/segment_anything_in_keras_hub_35_1.png)
![png](/img/guides/segment_anything_in_keras_hub/segment_anything_in_keras_hub_35_1.png)



Expand Down
53 changes: 12 additions & 41 deletions guides/md/keras_hub/stable_diffusion_3_in_keras_hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ To get started, let's install a few dependencies and get images for our demo:


```python
!!pip install -Uq keras
!!pip install -Uq git+https://github.com/keras-team/keras-hub.git
!!wget --user-agent="User-Agent: Mozilla/5.0" -O mountain_dog.png https://i.imgur.com/3AHYG9Z.png
!!wget --user-agent="User-Agent: Mozilla/5.0" -O mountain_dog_mask.png https://i.imgur.com/n3Prpj6.png
!pip install -Uq keras
!pip install -Uq git+https://github.com/keras-team/keras-hub.git
!wget --user-agent="User-Agent: Mozilla/5.0" -O mountain_dog.png https://i.imgur.com/3AHYG9Z.png
!wget --user-agent="User-Agent: Mozilla/5.0" -O mountain_dog_mask.png https://i.imgur.com/n3Prpj6.png
```


Expand All @@ -50,22 +50,7 @@ import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
```
<div class="k-default-codeblock">
```
['--2024-10-13 15:04:25-- https://i.imgur.com/n3Prpj6.png',
'Resolving i.imgur.com (i.imgur.com)... 151.101.196.193',
'Connecting to i.imgur.com (i.imgur.com)|151.101.196.193|:443... connected.',
'HTTP request sent, awaiting response... 200 OK',
'Length: 20520 (20K) [image/png]',
'Saving to: ‘mountain_dog_mask.png’',
'',
' 0K .......... .......... 100% 676K=0.03s',
'',
'2024-10-13 15:04:26 (676 KB/s) - ‘mountain_dog_mask.png’ saved [20520/20520]',
'']

```
</div>
---
## Introduction

Expand Down Expand Up @@ -139,21 +124,7 @@ preprocessor = keras_hub.models.StableDiffusion3TextToImagePreprocessor.from_pre
text_to_image = keras_hub.models.StableDiffusion3TextToImage(backbone, preprocessor)
```

<div class="k-default-codeblock">
```
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1728803077.293173 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.320598 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.320755 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.322098 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.322213 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.322309 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.325873 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.325981 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
I0000 00:00:1728803077.326081 2901459 cuda_executor.cc:1015] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355

```
</div>
Next, we give it a prompt:


Expand All @@ -172,7 +143,7 @@ display_generated_images(generated_image)



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_7_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_7_0.png)



Expand Down Expand Up @@ -253,7 +224,7 @@ display_generated_images(generated_images)



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_10_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_10_0.png)



Expand Down Expand Up @@ -285,7 +256,7 @@ Cost time (`num_steps=50`): 6.18s
```
</div>

![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_12_3.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_12_3.png)



Expand All @@ -309,7 +280,7 @@ display_generated_images(generated_images)



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_14_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_14_0.png)



Expand All @@ -331,7 +302,7 @@ display_generated_images(generated_images)



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_16_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_16_0.png)



Expand Down Expand Up @@ -384,7 +355,7 @@ display_generated_images(



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_19_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_19_0.png)



Expand Down Expand Up @@ -432,7 +403,7 @@ display_generated_images(generated_images)



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_22_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_22_0.png)



Expand Down Expand Up @@ -484,7 +455,7 @@ display_generated_images(



![png](/home/hongyu/workspace/keras-io/guides/img/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_24_0.png)
![png](/img/guides/stable_diffusion_3_in_keras_hub/stable_diffusion_3_in_keras_hub_24_0.png)



Expand Down
Loading