Today, Artificial Intelligence(AI) plays a crucial role in shaping our online experiences, often driving them.
When we publish posts on LinkedIn, share blog articles, or tweet, AI algorithms review them along with the hashtags and may reshare, retweet, or add them to relevant newsfeeds.
Financial trading bots may act on news published by reputable financial outlets regarding a company's results.
Perhaps the financial article may have been written, assisted by a language model like ChatGPT, just like business proposals, formal and informal emails.
AI algorithms generate product recommendations, AI-powered recruitment bots screen job applications, and advertising bots target our social media usage.
Chatbots offer AI-based customer support, Dall-E creates product images, and AI is winning art competitions.
The reality of an AI-based neuralink is already here, and it is conceivably not incorrect to say; business is conducted at the speed of AI, not speed of human interactions.
A few months back, Microsoft shared code forold photo restoration. The implementation was in pytorch.
I tried to use the code to restore some old damaged snaps. I found that not all old photos can be enhanced. Reasonably well defined blemishes and lines are handled well but diffused areas of damage don’t fare that as good.
Nevertheless it is a very impressive photo restoration using AI.
This is a step-by-step guide to using the code to restore your old photos using Google colab.
You need —
a. Gmail ID to run the colab notebook
b. Old photo (≤500 x 500 pixels only)
1. Copy the colab notebook
Save the colab notebook at this link to your own gdrive so that you can use this notebook in your google colab environment.
Save
Save a copy in drive
2. Change the run time environment
Change the runtime type to Python3 and the hardware accelerator to GPU as mentioned at the top of the notebook.
Instructions for runtime settings
GPU Hardware accelerator
3. Run the notebook cells
Run all the cells till the section ‘Try it on your own photos’. So all steps under ‘Git Clone’, ‘Set up the environment’, ‘Run the code’ need to be completed.
Run till ‘Try it on your own photos!’
4. Upload the files to be restored
When you run the cell after the heading ‘Try it on your own photos!’ you will see a button to ‘Choose files’. You can choose multiple files or a single file.
Single or Multiple files can be uploaded
5. With scratch or Without scratch flag
After the files are uploaded in the next cell — choose the restoration type. If the photos have scratches then simple add the flag --with-scratch at the end of the code. Otherwise no change to be made.
— with-scratch flag
6. Results display
After this cell completes its run, the result is displayed side by side with the original input picture.
Result — alongside the original picture
7. Download the results
Run the next cell which copies the output to a zip file and downloads this zip file. This downloaded file will contain the resultant restored image(s).
download.zip
8. Issues
Scaling images
If you upload a file that is more than 500x500 pixels — the large image is skipped and not processed.
Skips large images
You can scale images in GIMP or use any image editor tool to ensure it is within the limit prescribed.
Incognito Mode
If you run the colab notebook in Incognito mode you may come across this error message.
Upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable.
To overcome this — you can either run the notebook in regular chrome window or use whitelist cookies from google like this -