text: const API_KEY = "ENTER YOUR API";
  
  export const identifyClothes = async (image64) => {
    const Clarifai = require("clarifai");
    const app = new Clarifai.App({
      apiKey: API_KEY,
    });
  
    try {
      const response = await app.models.predict(
        "72c523807f93e18b431676fb9a58e6ad",
        {
          base64: image64,
        }
      );
      // console.log(response.outputs[0].data.regions);
      let mostLikely;
      if (response.outputs[0].data.regions) {
        mostLikely = response.outputs[0].data.regions
          .map((item) => {
            if (item.data.concepts[0].value > 0.8) {
              return item.data.concepts[0].name;
            }
          })
          .filter((item) => item !== undefined);
        mostLikely = mostLikely.filter((item, index) => {
          return mostLikely.indexOf(item) == index;
        });
      } else {
        mostLikely = [];
      }
      // console.log(mostLikely);
      return mostLikely;
    } catch (e) {
      console.log(e);
    }
  };
  
  export const identifyColors = async (image64) => {
    const Clarifai = require("clarifai");
    const app = new Clarifai.App({
      apiKey: API_KEY,
    });
  
    try {
      const response = await app.models.predict(
        "eeed0b6733a644cea07cf4c60f87ebb7",
        { base64: image64 }
      );
      let colors;
      //console.log(response.outputs[0].data.colors);
      if (response.outputs[0].data.colors) {
        colors = response.outputs[0].data.colors
          .map((item) => {
            if (item.value > 0.4) {
              return item.w3c.hex;
            }
          })
          .filter((item) => item !== undefined);
      } else {
        colors = [];
      }
      return colors;
      //console.log(colors);
    } catch (e) {
      console.log(e);
    }
  };
  