I want to create subfolders with related images for each class. Right now, I have a folder with all images. I created a .csv with images_name and Complexity (label). I am looking for the best ways to move all images to subdirectories according to Complexity(label) mentioned in the CSV file.
My folder structure looks like this:
- Folder
- Images
- DF.csv
I would like to create a subfolder and move all images according to complexity (labels)
- Subfolder
- Basic
- Moderate
- Complex
import pandas as pd
df =pd.read_csv("DF.csv")
df.head()
index | Title | Ingredients | Image_Name | Ingredient Count | Complexity |
---|---|---|---|---|---|
1 | Crispy Salt and Pepper Potatoes | ['2 large egg whites', '1 pound new potatoes (about 1 inch in diameter)', '2 teaspoons kosher salt', '¾ teaspoon finely ground black pepper', '1 teaspoon finely chopped rosemary', '1 teaspoon finely chopped thyme', '1 teaspoon finely chopped parsley'] | crispy-salt-and-pepper-potatoes-dan-kluger | 6 | Basic |
2 | Thanksgiving Mac and Cheese | ['1 cup evaporated milk', '1 cup whole milk', '1 tsp. garlic powder', '1 tsp. onion powder', '1 tsp. smoked paprika', '½ tsp. freshly ground black pepper', '1 tsp. kosher salt, plus more', '2 lb. extra-sharp cheddar, coarsely grated', '4 oz. full-fat cream cheese', '1 lb. elbow macaroni'] | thanksgiving-mac-and-cheese-erick-williams | 11 | Moderate |
3 | Italian Sausage and Bread Stuffing | ['1 (¾- to 1-pound) round Italian loaf, cut into 1-inch cubes (8 cups)', '2 tablespoons olive oil, divided', '2 pounds sweet Italian sausage, casings removed, divided', '1 stick unsalted butter, cut into pieces', '3 medium onions, chopped', '4 large celery ribs, chopped', '5 garlic cloves, minced', '4 large eggs, lightly beaten', '¾ cup heavy cream, divided', '½ cup turkey giblet stock or reduced-sodium chicken broth', '1 cup grated Parmigiano-Reggiano (2 ounces)', '½ cup coarsely chopped flat-leaf parsley', '4-qt shallow ceramic or glass baking dish'] | italian-sausage-and-bread-stuffing-240559 | 22 | Complex |
Any help would be appreciated. Thanks.