microsoft / studentambassadors

This repository is for Microsoft Learn Student Ambassadors.
MIT License
127 stars 47 forks source link

Optimize python script for Custom Vision learn module #173

Open Curiouspaul1 opened 1 year ago

Curiouspaul1 commented 1 year ago

Is your feature request related to a problem? Please describe.


--customVisionProject/
   - app.py
   - custom-photos/

image

image

(since we're now inside of the custom-photos directory we can use '.' inside the os.listdir() method.

image

Describe the solution you'd like

--customVisionProject/
   - app.py
   - custom-photos/

(which is the exact same as before). We can fetch the images as follows ( or rather the names of each sub-directory which we need to use as a tag name):

import os
...
path = os.path.abspath('./custom-photos')
tags = [name for name in os.listdir(path) if os.path.isdir(os.path.join(path, name))]

Describe alternatives you've considered

So I have practically been using my suggested change above as an alternative with the scripts, otherwise i just use the custom vision portal to upload the images.

Additional context

Add any other context or screenshots about the feature request here.


🎓 Add a tag to this issue for your current education role: student, Student Ambassador or educator.

Beta Student Ambassador


github-actions[bot] commented 1 year ago

Thank you for submitting this issue! The team will review your issue, tag with the appropriate tags, and comment with any additional questions on information needed. :sparkles: