Not sure if this is the right thread for my questions… I found it very frustrating trying to implement the web-application as in the lecture demo. I am using Colab and read the “warnings” but still decided to put some efforts trying to run something similar.
If I want to follow the example, I need to have my model (pkl file) on github on same folder as my classifier app. the problem here is I couldn’t find a convenient way saving my pkl file from the colab environment into github. I could download it to my desktop and than upload to github through github desktop… but felt I’m doing something way too complicated than it should be…
Since using Colab (and plan to continue doing so) is there any suggestion how to make something similar with Colab (any alternatives to Voila, Binder, maybe using Forms, colab widgets or any other idea for “quick production deployment”…)
Will highly appreciate your feedback
hi, when I was experimenting with the bear detector example I end up with interesting results. My error rate is actually 0 as you can see on the image below. (I downloaded around 150 images from bing for that exercise)
I’m wondering if this might be an indicator of some form of overfitting/memoization ?
In the video at around the 1:06:40 mark, The topic of model maintenance (how to update it over time, how to know if your model still works). It’s mentioned that there are few papers on this topic, despite its importance.
Could anyone point me to some (or even one) of these paper. Or even the terms to use for searching for them.
Hi there, I started the course and am really liking it (currently in lesson 2).
When trying to use the azure key, I always get this error and I can’t figure out what to do:
#To download images with Bing Image Search, sign up at Microsoft Azure for a free account. You will be given a key, which you can copy and enter in a cell as follows (replacing ‘XXX’ with your key and executing it):
key = os.environ.get('AZURE_SEARCH_KEY', 'XXX')
#Once you’ve set key, you can use search_images_bing. This function is provided by the small utils class included with the notebooks online. If you’re not sure where a function is defined, you can just type it in your notebook to find out:
Maybe I have to add that I don’t know what the key name is that I should replace the ‘XXX’ with. Jeremy Howard said that you would get one when signing up to Azure, but I didn’t.
Hi everyone! I am using DuckDuckGo to find bear images, and I can’t create the list of urls. First of all, I had to change the search_images_ddg cause it gave me errors:
def search_images_ddg(key,max_n=200):
"""Search for 'key' with DuckDuckGo and return a unique urls of 'max_n' images
(Adopted from https://github.com/deepanprabhu/duckduckgo-images-api)
"""
url = 'https://duckduckgo.com/'
params = {'q':key}
res = requests.post(url,data=params)
searchObj = re.search(r'vqd=([\d-]+)\&',res.text)
if not searchObj: print('Token Parsing Failed !'); return
requestUrl = url + 'i.js'
headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0'}
params = (('l','us-en'),('o','json'),('q',key),('vqd',searchObj.group(1)),('f',',,,'),('p','1'),('v7exp','a'))
urls = []
while True:
try:
res = requests.get(requestUrl,headers=headers,params=params)
data = json.loads(res.text)
for obj in data['results']:
urls.append(obj['image'])
max_n = max_n - 1
if max_n < 1: return L(set(urls)) # dedupe
if 'next' not in data: return L(set(urls))
requestUrl = url + data['next']
except:
pass
ims = search_images_ddg('grizzly bear', max_n=200)
len(ims)
This cell worked, but then I wasn’t able to run fns = get_image_files(path). Am I missing something? Maybe, there is a mistake while changing search_images_ddg. Below is the screenshot of code: search_images_fail|690x309
This works for me. Be sure to be use the correct version of search_images_ddg(), as the pip version is different. (I wrote this function and at one point it was committed to the fastaibook repository. Somehow the pip version of fastaibook has different code.)
Here is just a picture of what works for me. I haven’t looked at this for months, so it may take me a bit to get back up to speed if you have more questions.)
Thank you very much! I saw that you don’t have dest = 'images/grizzly.jpg' and download_url(ims[0], dest). I’ve run cells as on your screenshot, avoiding download_url and dest, and it worked! Thank you very much, now everything works
I’ve addressed this issue previously. I originally wrote the search_images_ddg code and contributed it to fastbook Github repo. Somehow, the version that was packaged into pip was altered. Here is code from the fastbook github repo that works.
(If someone can tell me how to send a request to update the pip package, that would be great!)
from fastbook import *
def search_images_ddg(key,max_n=200):
"""Search for 'key' with DuckDuckGo and return a unique urls of 'max_n' images
(Adopted from https://github.com/deepanprabhu/duckduckgo-images-api)
"""
url = 'https://duckduckgo.com/'
params = {'q':key}
res = requests.post(url,data=params)
searchObj = re.search(r'vqd=([\d-]+)\&',res.text)
if not searchObj: print('Token Parsing Failed !'); return
requestUrl = url + 'i.js'
headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0'}
params = (('l','us-en'),('o','json'),('q',key),('vqd',searchObj.group(1)),('f',',,,'),('p','1'),('v7exp','a'))
urls = []
while True:
try:
res = requests.get(requestUrl,headers=headers,params=params)
data = json.loads(res.text)
for obj in data['results']:
urls.append(obj['image'])
max_n = max_n - 1
if max_n < 1: return L(set(urls)) # dedupe
if 'next' not in data: return L(set(urls))
requestUrl = url + data['next']
except:
pass