labeling image data
Dataset for testing¶
For contributer of this library, you can use the default testing images in ../test/img, or you can uncomment the following and download more data you like
# !pip install -q jmd_imagescraper
# from jmd_imagescraper.core import duckduckgo_search, ImgSize
# duckduckgo_search("../test/img", "Nature", "nature", max_results=20)
!du -sh ../test
Labeler¶
Try labeler¶
slabel = SingleClassImageLabeler("../test")
slabel
slabel()
slabel.progress["data"]
mlabel = MultiClassImageLabeler("../test")
mlabel
mlabel(labels=["spring", "summer", "autumn", "winter"])
get_y
get_y = slabel.get_y
Multicategorical label¶
Create gey_y from a running MultiClassImageLabeler¶
mlabel.get_y(str(Path('../test/img/Nature/007_9554a747.jpg').resolve()))
Look at the data progress
mlabel.progress["data"]
Create a get_y function from csv file¶
get_y = MultiClassImageLabeler.gety_from_csv("./progress.csv")
Create a get_y function from external csv file, please pass in name of the image path column and label column
get_y = MultiClassImageLabeler.gety_from_csv("./progress.csv", path="image_path", label="pepper_types")
get_y('../test/img/Nature/004_26fb347c.jpg')
how we label multi categorical?
- please do it as following
pd.read_csv("./progress.csv")["label"]