Using AI to Power Your Images
Doug Sillars
Openweb Sarajevo
January 7, 2020
Contact Me:
@DougSillars
Doug.Sillars@gmail.com
www.dougsillars.com
Doug Sillars
Freelance Developer Relations
Performance Audits: Web/Native
Workshops:
Performance/Images/Video/AR/ML
http://bit.ly/HighPerformanceAndroidApps
Images Dominate the Web
HTTPArchive mobile websites 04/2019
Image Prep for the Web
Image Prep for the Web
Image Prep for the Web
Image Prep for the Web
Image Prep for the Web
Shortcuts for Image Prep?
Shortcuts for Image Prep?
Ensure You are delivering the optimal image
Shortcuts: Taking screenshots of Photoshop
Shortcuts for Image Prep?
Images on the web named screen*shot
426,000 screenshots live on the web
April 2019
Images on the web named screen*shot
106,000 sites with Screen Shots
April 2019
Images on the web named screen*shot
5M sites tested
106,000 sites with Screen Shots
Images on the web named screen*shot
5M sites tested
106,000 sites with Screen Shots 2.1%
of the
web!
=
Image Formats – Screenshots -> JPG
https://dougsillars.com/2019/02/10/using-screenshots-in-production/
Sometimes our Shortcuts have lasting effects
Shortcuts for Image Prep?
Shortcuts for Image Prep?
Shortcuts for Image Prep?
https://res.cloudinary.com/dougsillars/image/upload/c_crop,h_1000,w_1000,q_auto,f_auto/v1558503538/doug_headshot_alps
_tfzado.jpg
Shortcuts for Image Prep?
https://res.cloudinary.com/dougsillars/image/upload/c_crop,h_1000,w_1000,q_auto,f_auto/v1558503538/doug_headshot_alps
_tfzado.jpg
120 KB
Shortcuts for Image Prep?
Shortcuts for Image Prep?
https://res.cloudinary.com/dougsillars/image/upload/c_crop,h_1080,w_1000,q_auto,f_auto/
v1558504239/IMG_20160527_131042692_HDR_c21a3k.jpg
Shortcuts for Image Prep
Manual crop
Shortcuts for Image Prep
Manual crops are not a shortcut
Shortcuts for Image Prep: Detection of Objects
https://res.cloudinary.com/dougsillars/image/upload/g_auto,c_crop,w_1000,h_1000/
v1558504239/IMG_20160527_131042692_HDR_c21a3k.jpg
Image Cropping in Production: Twitter
Image Cropping in Production: Twitter
https://blog.twitter.com/engineering/en_us/topics/infrastructure/2018/Smart-Auto-Cropping-of-Images.html
Object Detection Using Machine Learning
• ImageAI library
• Tensorflow based
• Need Image Model Library
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.1.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "berwickontweed.jpg"),
output_image_path=os.path.join(execution_path , "resnet.jpg"))
resnet=plt.imread('resnet.jpg')
https://medium.com/deepquestai/train-object-detection-ai-with-6-lines-of-code-6d087063f6ff
Object Detection Using Machine Learning
Object Detection Using Machine Learning
Object Detection with Machine Learning
Object Detection
• Cropping
Object Detection
• Cropping
• Blurring objects
Object Detection
• Cropping
• Blurring objects
• Object Removal
http://bit.ly/bootsphoto
Object Detection
• Cropping
• Blurring objects
• Object Removal
• Alt Text Creation
Object Detection
• Cropping
• Blurring objects
• Object Removal
• Alt Text Creation
Alt = “A Person and 2 dogs”
If the Object is not Modeled…
If the Object is not Modeled…
•person : 99.72
•dog : 88.67
•dog : 96.92
…Try a new library
• https://llama.vision
…Try a new library
• https://llama.vision
Object Detection Using Machine Learning
ML ALT text in production
alt="Image may contain:
bridge, sky, tree,
outdoor, water and
nature"
ML ALT text in production
alt="Image may
contain: dog"
ML ALT text in production
…Or you can train a model
Google Object Detection
Google Object Detection: Model Creation
Google Object Detection: Model Creation
Google Object Detection: Model Creation
Google Object Detection: Model Creation
Train Your Model
Precision: How often Model’s
predictions were correct. In this case
1/6 is a false positive
Recall: How often model found
known objects. 1/6 is a missed
prediction.
Deploy Model and Use
Deploy Model and Use
Model Results!!
Model Results!!
Image Fix 1: Cropping
Image Fix 1: Cropping
Image Fix 1: Cropping
Image Fix 2: Inpainting
Image Fix 2: Inpainting
Create a mask of the area
Image Fix 2: Inpainting
Create a mask of the area
Image Fix 2: Inpainting
Image Fix 2: Inpainting
InPaint: Works well on single color areas
InPaint: Works Not So well with lots of color
Tricking InPaint
Remove “outlier” colors from
the border
Use the inside as inpainting area
Tricking InPaint
Convert to Grayscale
colors are 0 – 255 (1D)
Kmeans to bucket the colors
Tricking InPaint
Tricking InPaint
10 most common gray colors found
Tricking InPaint
10 most common gray colors found
Frequency
Tricking InPaint 1. Loop through Color list
Tricking InPaint 2. Ignore the White Center
Tricking InPaint
3. If Color is an outlier
(lower than 25th percentile
Higher than 75th)
Mask and replace
Tricking InPaint
Tricking InPaint
Tricking InPaint
Ai powered images-sarajevo
Sunglasses Project
Sunglasses Project
Manually edit 1,000s of glasses?
Sunglasses Project
Sunglasses Project
Sunglasses Project
Sunglasses Project
1. Remove Background
Sunglasses Project
1. Remove Background
Sunglasses Project
2. Make (slightly) transparent
https://res.cloudinary.com/dougsillars/image
/upload/e_make_transparent,o_70/v1558760
129/6658.png
Train a model!
Want to minimize frame capture
Train a model!
Beginning
Find the arms
Find the arms
Finding an Odd number: Fail
Modify the border around the arms
Inpaint and upload
Putting it all together
https://res.cloudinary.com/dougsillars/image/upload/v1558855691/IMG_20181207_163533_ibfm7a.jpg
Putting it all together
https://res.cloudinary.com/dougsillars/image/upload/c_crop,g_face,w_1500,h_1500/v1558855691/IMG_2018120
7_163533_ibfm7a.jpg
Putting it all together
https://res.cloudinary.com/dougsillars/image/upload/c_crop,g_face,w_1500,h_1500/v1558855691/IMG_2018120
7_163533_ibfm7a.jpg
l_6558_f,o_80,e_make_transparent/
Putting it all together
https://res.cloudinary.com/dougsillars/image/upload/c_crop,g_face,w_1500,h_1500/l_6558_f,o_80,e_make_transparent/
g_adv_eyes,fl_layer_apply/v1558855691/IMG_20181207_163533_ibfm7a.jpg
Demo Time
https://res.cloudinary.com/dougsillars/image/upload/c_crop,g_face,w_1500,h_1500/l_6558_f,o_80,e_make_transparent/
g_adv_eyes,fl_layer_apply/v1558855691/IMG_20181207_163533_ibfm7a.jpg
Conclusion
• Image processing with AI and ML can simplify image prep for the web
• Cropping
• Blurring
• Object removal
• Alt text
Love Building with Video and Images?
Media Developer Expert
mde-comm@cloudinary.com
Become a

More Related Content

PPTX
Ai powered images-pythonljubjana
PPTX
Ai powered images-gdgtirana
PPTX
Ai powered images-geneva
PPTX
Ai powered images-frankfurt
PPTX
Ai powered images-nibelfast
PPTX
Ai powered images-fullstackporto
PPTX
Ai powered images-madridsc
PPTX
Ai powered images-opieaivienna
Ai powered images-pythonljubjana
Ai powered images-gdgtirana
Ai powered images-geneva
Ai powered images-frankfurt
Ai powered images-nibelfast
Ai powered images-fullstackporto
Ai powered images-madridsc
Ai powered images-opieaivienna

Similar to Ai powered images-sarajevo (20)

PPTX
Ai powered images-zurichpydata
PPTX
Ai powered images-mobileera
PPTX
Ai powered images-fullstackporto
PPTX
Ai powered images-belfast
PPTX
Ai powered images
PPTX
Ai powered images-seattle
PDF
46.-Applications-of-AI-Image-Processing.pdf
PDF
Deep Learning for Computer Vision - Image Classification, Object Detection an...
PPT
Introduction to Digital Image Processing
PPTX
project_final_seminar
PPTX
Ai use cases
PDF
Challenges of Deep Learning in Computer Vision Webinar - Tessellate Imaging
PPTX
Presentation-lokesh IMAGES for research.pptx
PDF
Annotation tools for ADAS & Autonomous Driving
PPTX
Image processing tool box.pptx
PDF
Photoshop key points
PPTX
Image analytics - A Primer
PDF
automated-optical-inspection-and-defect-detection-for-industrial-applications...
PPTX
IntroComputerVision23.pptx
PPT
Matlab
Ai powered images-zurichpydata
Ai powered images-mobileera
Ai powered images-fullstackporto
Ai powered images-belfast
Ai powered images
Ai powered images-seattle
46.-Applications-of-AI-Image-Processing.pdf
Deep Learning for Computer Vision - Image Classification, Object Detection an...
Introduction to Digital Image Processing
project_final_seminar
Ai use cases
Challenges of Deep Learning in Computer Vision Webinar - Tessellate Imaging
Presentation-lokesh IMAGES for research.pptx
Annotation tools for ADAS & Autonomous Driving
Image processing tool box.pptx
Photoshop key points
Image analytics - A Primer
automated-optical-inspection-and-defect-detection-for-industrial-applications...
IntroComputerVision23.pptx
Matlab
Ad

More from Doug Sillars (20)

PPTX
Fastandbeautiful belfast
PPTX
Fastandbeautiful gdg sacremento
PPTX
Fastandbeautiful gd glittlerock
PPTX
Fastandbeautiful webinale
PPTX
Fastandbeautiful zagrebtechsauna
PPTX
Video js zagreb
PDF
Vkmdp cologne
PPTX
A rt gallery pantalks
PPTX
A rt gallery hub387
PPTX
Fastandbeautiful vienna
PPTX
A rt gallery devfestlondon
PPTX
Fastandbeautiful devfest london
PPTX
A rt gallery cardiff
PPTX
Fastandbeautiful oredev
PPTX
A rt gallery oredev
PPTX
A rt gallery webcamp-zg
PPTX
Qa fest kiev_when its just too slow
PPTX
A rt gallery coding-serbia_novisad
PPTX
Armadajs video
PPTX
Fastandbeautiful novi sad
Fastandbeautiful belfast
Fastandbeautiful gdg sacremento
Fastandbeautiful gd glittlerock
Fastandbeautiful webinale
Fastandbeautiful zagrebtechsauna
Video js zagreb
Vkmdp cologne
A rt gallery pantalks
A rt gallery hub387
Fastandbeautiful vienna
A rt gallery devfestlondon
Fastandbeautiful devfest london
A rt gallery cardiff
Fastandbeautiful oredev
A rt gallery oredev
A rt gallery webcamp-zg
Qa fest kiev_when its just too slow
A rt gallery coding-serbia_novisad
Armadajs video
Fastandbeautiful novi sad
Ad

Recently uploaded (20)

PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
STKI Israel Market Study 2025 version august
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
The various Industrial Revolutions .pptx
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Modernising the Digital Integration Hub
PDF
CloudStack 4.21: First Look Webinar slides
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPT
Geologic Time for studying geology for geologist
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
A comparative study of natural language inference in Swahili using monolingua...
STKI Israel Market Study 2025 version august
Final SEM Unit 1 for mit wpu at pune .pptx
The various Industrial Revolutions .pptx
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Modernising the Digital Integration Hub
CloudStack 4.21: First Look Webinar slides
1 - Historical Antecedents, Social Consideration.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Assigned Numbers - 2025 - Bluetooth® Document
Univ-Connecticut-ChatGPT-Presentaion.pdf
DP Operators-handbook-extract for the Mautical Institute
Hindi spoken digit analysis for native and non-native speakers
A novel scalable deep ensemble learning framework for big data classification...
Geologic Time for studying geology for geologist
Zenith AI: Advanced Artificial Intelligence
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Module 1.ppt Iot fundamentals and Architecture
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf

Ai powered images-sarajevo

Editor's Notes

  • #43: https://twitter.com/SteveStuWill/status/1186653595518652416