Title: ML Days in Tashkent — Day 1: City Tour - PyImageSearch

URL Source: https://pyimagesearch.com/2023/12/04/ml-days-in-tashkent-day-1-city-tour/

Published Time: 2023-12-04T14:00:00+00:00

Markdown Content:
* * *

**Table of Contents**
---------------------

*   [ML Days in Tashkent — Day 1: City Tour](#h2BPTitle)

*   [Arriving at Tashkent!](#h3Arriving)
*   [City Tour](#h3Tour)
*   [Memorial to the Victims of Repression](#h3Memorial)
*   [Barak Khan Madrasa](#h3Madrasa)
*   [Minor Mosque](#h3Mosque)
*   [Chorsu Bazaar](#h3Bazaar)
*   [Metro Ride Back to the Hotel](#h3Ride)
*   [Generating Images with Stable Diffusion](#h3Generating)

*   [Summary](#h2Summary)

*   [A Peek into the Google ML Community Summit](#h3Peek)
*   [A Balance of Enjoyment and Learning](#h3Balance)
*   [Gratitude to Tashkent](#h3Gratitude)

* * *

In this tutorial, we will take a departure from our regular machine learning (ML) blogs and discover how our authors made the most of the Google for Developers Machine Learning Community Summit in Tashkent. But stick around for a surprise demo at the end.

[![Image 1](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20603%20500'%3E%3C/svg%3E)](https://pyimagesearch.com/wp-content/uploads/2023/12/tashkent-1-featured.png)

This blog is the 1st of a 3-part series:

1.  [**_ML Days in Tashkent — Day 1: City Tour_**](https://pyimg.co/g3bha) **(this tutorial)**
2.  _ML Days in Tashkent — Day 2: Sprints and Sessions_
3.  _ML Days in Tashkent — Day 3: Demos and Workshops_

* * *

[**ML Days in Tashkent — Day 1: City Tour**](#TOC-h2BPTitle)
------------------------------------------------------------

* * *

### [**Arriving at Tashkent!**](#TOC-h3Arriving)

For us, arriving in Tashkent, the capital city of Uzbekistan, was like stepping into a vibrant tapestry of culture and beauty.

As Google Developer Experts in Machine Learning, we (Ritwik Raha and Aritra Roy) had the distinct honor of being invited by Google to this mesmerizing city. Our invitation was a recognition of our contributions to the Machine Learning community, and the event in question was the much-anticipated annual Google Machine Learning Community Summit.

Tashkent, with its pristine streets and welcoming populace, was a delightful setting for this gathering of minds. The city exuded an instantly captivating warmth, and it was not just the physical beauty of the place that struck us, but also the rich cultural fabric from which it was woven.

[![Image 2](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20230'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/-NCKMwEH7eoYCc5COkOvBNMEIxch85kxh8dYqpR6ZivVVTEbhu8wh3ERAa0R5PHdxvMAeyJ5xOHPcF9kAip0yw4eb-bksDC0NiaqHBTcLoHhwFPak2oEeGS0i37IFKHJzoFXErvutQaPRCBHd8Naa1I)

You might have noticed some images accompanying this post. And before you compliment us on our photography skills, let’s clear the air: these images are not photographs in the traditional sense. Surprised? Well, that’s the beauty of the field we are immersed in. These vivid images were generated using Stable Diffusion, a state-of-the-art technique in Machine Learning, and it only took us four lines of code to create them! If you’re curious about how this was done, stay with us as we delve deeper into this fascinating topic.

Our journey in Tashkent began at the luxurious Hotel InterContinental, where 11 of us from India converged. After a quick check-in, we parked our luggage and immediately set off to explore the city. The excitement was palpable among us, not just for the summit, but also to experience the essence of Tashkent through its streets, monuments, and people.

As we embarked on our city tour, we were constantly reminded of how beautiful and vibrant this land is. The upcoming summit promised to be a confluence of ideas and innovations, where experts from various countries would share their insights and experiences.

* * *

### [**City Tour**](#TOC-h3Tour)

Tashkent as a city has so many tourist places, we could not see all of them. Here are some of the sites we visited.

Our tour of Tashkent was an eye-opener to the rich history and culture of Uzbekistan. Though we couldn’t visit all the tourist spots, the ones we did explore left an indelible mark on us. Here’s a glimpse into some of these remarkable places.

* * *

### [**Memorial to the Victims of Repression**](#TOC-h3Memorial)

[![Image 3](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20667%20500'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/WxYiMMJzEsqade1eAByQVlnI8jZfgdQFcQLSX0eatCNpPgrrZ5pEko0r4UJODLzbAszurJ62OTftZyBRT1-W8EpiGL9lL9S850yqRdz2tb8IKrH1IviQQmqV8pRJXKbn3VOkHzstFmRw0TXBt8kL8SE)

This memorial is an imposing structure with a large, gazebo-shaped design topped by a striking blue dome. It’s not just the architecture that captivates you, but the poignant story it tells. Adjacent to it is the Museum of the Victims of Political Repression. This structure, albeit beautiful, carries a somber tale. It is dedicated to the brave souls who fought for Uzbekistan’s independence during the Soviet era and tragically lost their lives at the hands of the government. The museum houses photographs, documents, and personal belongings of those who were killed, serving as a powerful reminder of their sacrifice.

* * *

### [**Barak Khan Madrasa**](#TOC-h3Madrasa)

[![Image 4](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20667%20500'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/CSb0meUHT9VfmyxtZGKozfDE3iBffhZNKTBz5W-YtjazcLWZACLTWvwFhtDUuWVrCQGl7ChIG4VCofpnxvY5wuJllEkjItBQeMmNWfvPDyhW9An9VS8wPf1GzXpz_xU4m-TDi72nGbwt06KonwdljSg)

Our visit to the Barak Khan Madrasa was an introduction to the splendid Islamic architecture that is prevalent in Uzbekistan. These structures, found elsewhere as well, are a testament to the rich cultural heritage of the country. The courtyard of the Barak Khan Madrasa is open to visitors, offering a serene and introspective experience.

* * *

### [**Minor Mosque**](#TOC-h3Mosque)

[![Image 5](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20375%20500'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/xcHqRL7ynTmdVx641B1mG7lLVT6c97wVzp854UpiIzg4RnXoi6XJq0-4HXfbZvuIJn2hdAdp6LswLaxfh5AJiylJ0tO_tjZFPVmnbs5r5Ihvn4KpNS7ZZguBRAXgkawwsersd33A4ehSd76s_YXU49s)

The [Minor Mosque](https://goo.gl/maps/4n8dGauskXHdTRwo8) is a relatively new yet magnificent addition to Tashkent’s skyline. Built in 2014 along the Ankhor Canal, it’s fondly known as the “Snow Mosque” due to its pristine white marble construction. The mosque is a sight to behold, especially when sunlight dances off its surfaces, making it shimmer and sparkle.

* * *

### [**Chorsu Bazaar**](#TOC-h3Bazaar)

[![Image 6](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20667%20500'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/gDpAr4rJi9lrDeCRnD-GSxYfMuVsBL6Jmt5id53UlrtuHE-gq2nbK1sSuiArwBsZZi5q_teEpmPkDZ_Yx3SsKJtzq4igo94EynY-PCtZZ63ruU4hbGmUbDEnF_JrIalQHySlSBYXBbChxlyG2uANTMs)

A visit to Tashkent would be incomplete without experiencing the [Chorsu Bazaar](https://goo.gl/maps/7FgtmbFLNWpzMbDY6), Uzbekistan’s largest market. Here, the vibrancy of local life is on full display. From fresh produce, spices, honey, and food products to clothing, jewelry, and beauty items, you can find almost anything here. The bazaar is a bustling hub of commerce and culture, offering a slice of everyday life in Uzbekistan.

* * *

### [**Metro Ride Back to the Hotel**](#TOC-h3Ride)

[![Image 7](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20667%20500'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/-zSSJdHvj-2-jaSH9xVCXPGk8cEZuaWJMt3Vex2AK2DSRRppprsOdhZzPOgXUI0B6ROCjMNnzy3cmfABtQAdOsQHXHB0nu-0FL2FKDVUQpn1aS98-jzPVBO_6txPO9IrVdvvPdXarcgeQMBWLE6k0X0)

The journey back to our hotel was via the oldest Metro in Central Asia. Each station is a work of art in itself, reflecting the country’s rich history and culture. What truly stood out, however, was the warmth and politeness of the people. Despite the busy rush, everyone we encountered was warm, welcoming, and full of smiles.

* * *

### [**Generating Images with Stable Diffusion**](#TOC-h3Generating)

As we retreated to our hotel, our minds were filled with images and stories, some uplifting and some poignant, all of which enriched our understanding of this beautiful country.

And now, finally, as promised, let us see how to generate photo-realistic images (ahem!) using Stable Diffusion with Keras-CV in about 4 lines of code.

!pip install -q git+https://github.com/keras-team/keras-cv.git@master
!pip uninstall -q keras -y
!pip uninstall -q tensorflow -y
!pip install -q tf-nightly # needed for some data processing in keras-cv
!pip install -q keras-nightly

On **Lines 1-5**, we start by installing the necessary Python packages. We install `keras-cv` directly from its GitHub repository, uninstall existing versions of `keras` and `tensorflow`, and then install the nightly builds of TensorFlow (`tf-nightly`) and Keras (`keras-nightly`). These nightly builds are often used to access the latest features and bug fixes that haven’t been released in stable versions yet.

import os
os.environ\["KERAS\_BACKEND"\] = "torch"
import keras
import keras\_cv

On **Lines 6-9**, we import essential Python libraries. `os` is a standard Python library, with `os` being used to set environment variables. Here, we are using the “torch” backend. To learn how to use Keras Core with different backends, [read our blog post on Keras Core](https://pyimagesearch.com/2023/07/24/what-is-keras-core/).

The `keras` and `keras_cv` imports are for using Keras and its computer vision extensions, respectively.

stable\_diffusion = keras\_cv.models.StableDiffusion()
stable\_diffusion.jit\_compile = False # this is work in progress

prompt = """"machine learning summit in the city of tashkent, with \\
the theme of a middle-eastern market where spices and tea is made of code elements"""

images = stable\_diffusion.text\_to\_image(
    prompt,
    batch\_size=3,
)

On **Lines 10 and 11**, we initialize a `StableDiffusion` model from `keras_cv.models`. This model is used for text-to-image generation. We then set its `jit_compile` attribute to `False`, indicating that the just-in-time compilation is disabled. This might be due to the model still being in a developmental stage.

On **Lines 16-19**, we use the `stable_diffusion.text_to_image` method to generate images based on a given text prompt. Here, the prompt describes:

`"machine learning summit in the city of tashkent, with \`  
`the theme of a middle-eastern market where spices and tea is made of code elements"`

Feel free to input your own prompts.

We specify a `batch_size` of `3`, indicating that three images will be generated.

keras\_cv.visualization.plot\_image\_gallery(
    images,
    value\_range=(0,255),
    scale=2,
    rows=1,
    cols=3,
    show=True,
)

Finally, on **Lines 20-27**, we call the `keras_cv.visualization.plot_image_gallery` function to display these generated images.

[![Image 8](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20700%20230'%3E%3C/svg%3E)](https://lh7-us.googleusercontent.com/u0qEI7cHoM-qtjSJyFhZabvRMzkAZasDkv76q4QlIQ4gITKl-xv6gDhgVUNoI6ox5vPc7Qi49R4HWVfsnYXjvHy2woTruaphWbV2m2fvsZukp9iXuDrQEgen-nvc0WRP0wPydZ4yRiyG5augDGKhytw)

**_Note:_** PyImageSearch is not responsible for any biased representation of generated images.

* * *

[**Summary**](#TOC-h2Summary)
-----------------------------

As we wrap up our recount of the vibrant city tour in Tashkent, let’s shift our focus to the main reason for our visit: the Google Machine Learning Community Summit. This event was not just a typical conference; it was a unique blend of advanced learning, hands-on experience, and cultural immersion.

* * *

### [**A Peek into the Google ML Community Summit**](#TOC-h3Peek)

The summit was a melting pot of ideas and innovations in the Machine Learning field. It was fascinating to see how Google, a pioneer in this field, orchestrated an event that was both informative and enjoyable. In our upcoming posts, keep an eye out for detailed insights into what the summit entailed. We’ll be diving deep into state-of-the-art ML products and APIs showcased at the event.

Expect to find a mix of technical deep dives and practical demonstrations. Whether you’re a seasoned ML practitioner or a curious enthusiast, there will be plenty of material to get your hands dirty with. We’ll share our experiences with the latest tools and technologies, giving you a firsthand look at the advancements shaping the future of ML.

* * *

### [**A Balance of Enjoyment and Learning**](#TOC-h3Balance)

One of the most impressive aspects of the summit was how Google managed to strike a perfect balance between a rigorous technical conference and an enjoyable experience. The sessions were packed with updates and new releases, yet there was always an undercurrent of excitement and engagement. This balance made the learning process not just enriching but also incredibly fun.

* * *

### [**Gratitude to Tashkent**](#TOC-h3Gratitude)

As we prepare to delve into the technicalities and learnings from the summit, we express our heartfelt gratitude to the city of Tashkent and its wonderful people. The warmth, hospitality, and rich culture we experienced here added a special flavor to our journey. It wasn’t just a trip; it was an experience that gave us memories to cherish for a lifetime. To the beautiful city of Tashkent and its incredible people: Thank You.

Stay tuned for our upcoming posts, where we’ll share the technical treasures from the Google ML Community Summit. We’re excited to bring you along on this journey of exploration and discovery in the world of Machine Learning.

* * *

![Image 9](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20410%20567'%3E%3C/svg%3E)

#### Join the PyImageSearch Newsletter and Grab My FREE 17-page Resource Guide PDF

Enter your email address below to **join the PyImageSearch Newsletter** and **download my FREE 17-page Resource Guide PDF** on Computer Vision, OpenCV, and Deep Learning.