• 开源|商品识别推荐系统


    几个月前做的项目,整理一下,比较简单,就是根据数据集进行图片分类(使用resnet50),再通过识别结果匹配推荐数据库,进行推荐

    前端:html、js

    后端:python-flask框架、pytorch框架

    项目结构:

    dataset_dir文件夹:数据集放进这个文件夹,不同种类图片放进对应种类文件夹,再通过

    models文件夹:存放训练好的模型

    static文件夹:存放前端网页显示的需要的图片

    templates文件夹:前端网页模板文件

    inference.py 测试推理效果的文件

    label.py

    1. from torchvision.datasets import ImageFolder
    2. dataset=ImageFolder("C:/Users/forwhat/Desktop/recommend/cloth/train") #获取路径,返回的是所有图的data、label
    3. print(dataset.class_to_idx) #查看类别名,及对应的标签。
    4. print(dataset.imgs) #查看路径里所有的图片,及对应的标签

     label_level2.py

    1. under_jeans =['https://detail.tmall.com/item.htm?id=636464038643','https://detail.tmall.com/item.htm?id=629142114736','https://item.taobao.com/item.htm?id=633482107680','https://item.taobao.com/item.htm?id=653135699650'
    2. ,'https://detail.tmall.com/item.htm?id=626092831491']
    3. under_skirt = ['https://item.taobao.com/item.htm?id=667268983604','https://detail.tmall.com/item.htm?id=668100149427','https://detail.tmall.com/item.htm?id=586698989166','https://detail.tmall.com/item.htm?id=635332780625'
    4. ,'https://detail.tmall.com/item.htm?id=637917736279']
    5. under_sporty = ['https://detail.tmall.com/item.htm?id=613077657236','https://detail.tmall.com/item.htm?id=580354266231','https://detail.tmall.com/item.htm?id=580354266231','https://detail.tmall.com/item.htm?id=653363447356','https://item.taobao.com/item.htm?id=579123847078'
    6. ,'https://detail.tmall.com/item.htm?id=42730275588']
    7. under_suit = ['https://detail.tmall.com/item.htm?id=618731089852','https://detail.tmall.com/item.htm?id=618596933879','https://detail.tmall.com/item.htm?id=636256949983','https://detail.tmall.com/item.htm?id=636363512038'
    8. ,'https://item.taobao.com/item.htm?id=665038582357']
    9. upper_casual = ['https://detail.tmall.com/item.htm?id=666855488772','https://detail.tmall.com/item.htm?id=667962767730','https://detail.tmall.com/item.htm?id=610974657070','https://detail.tmall.com/item.htm?id=645567560209'
    10. ,'https://detail.tmall.com/item.htm?id=644415535799']
    11. upper_coat = ['https://item.taobao.com/item.htm?id=552053460493','https://item.taobao.com/item.htm?id=598306760200','https://detail.tmall.com/item.htm?id=665519667811','https://detail.tmall.com/item.htm?id=585993479022'
    12. ,'https://item.taobao.com/item.htm?id=649233831246']
    13. upper_hoodie = ['https://detail.tmall.com/item.htm?id=666165898023','https://item.taobao.com/item.htm?id=652872409153','https://item.taobao.com/item.htm?id=628894958150','https://detail.tmall.com/item.htm?id=633528937891'
    14. ,'https://item.taobao.com/item.htm?id=656080489764']
    15. upper_sporty = ['https://item.taobao.com/item.htm?id=628559051772','https://detail.tmall.com/item.htm?id=668803933152','https://detail.tmall.com/item.htm?id=655672026380','https://detail.tmall.com/item.htm?id=631357306618'
    16. ,'https://detail.tmall.com/item.htm?id=601009441405']
    17. upper_suit = ['https://detail.tmall.com/item.htm?id=666236552324','https://detail.tmall.com/item.htm?id=668803933152','https://item.taobao.com/item.htm?id=625828294674','https://detail.tmall.com/item.htm?id=649272374842','https://detail.tmall.com/item.htm?id=666063758350'
    18. ,'https://item.taobao.com/item.htm?id=668250478482']
    19. whole_dress = ['https://detail.tmall.com/item.htm?id=598268797504','https://item.taobao.com/item.htm?id=666364831194','https://detail.tmall.com/item.htm?id=667095587171','https://detail.tmall.com/item.htm?id=642013218199'
    20. ,'https://detail.tmall.com/item.htm?id=669133765583']

    split_dataset.py脚本对数据集进行训练集、验证集、测试集的划分。

    train.py脚本对数据集进行训练

    数据集

    符合格式就可以,参考链接一

    效果展示 

    点击一个链接看看  

    开源地址

    基于神经网络的简单推荐系统: 几个月前做的项目,整理一下,比较简单,就是根据数据集进行图片分类(使用resnet50),再通过识别结果匹配推荐数据库,进行推荐。 (gitee.com)

    参考资料

    (195条消息) 【深度学习】使用python划分数据集为训练集和验证集和测试集并放在不同的文件夹_我系渣渣的博客-CSDN博客_python划分数据集为训练集和测试集

  • 相关阅读:
    Springboot结合Netty对接硬件,实现主动发送报文和接受硬件报文(ModbusRTU或者TCP以及DTU)
    高优先线程
    Nginx Mysql负载均衡 初步配置及验证 笔记
    KMP算法 (自己复习专用)
    在PhpStorm中hyperf调试的方法步骤是什么
    【数据结构】10道经典面试题目带你玩转链表
    RHCSA认证考试----3.配置 SELinux
    【示波器专题】数字示波器的主要指标——采样率
    日语等级J.TEST的自测卷
    Flink之Watermark生成策略
  • 原文地址:https://blog.csdn.net/weixin_43332715/article/details/126074556