# coding: utf-8 # In[1]: from detecting.build.fasterrcnn import FasterRCNNModel from detecting.datasets.datasets import load_data_generator from detecting.datasets.utils import get_original_image from detecting.config import cfg # In[2]: # cfg.merge_from_file('test.yml')使用'test.yml'修改默认配置 cfg.merge_from_file('test.yml') # 然后把新的cfg传给模型 model = FasterRCNNModel(cfg) # In[3]: # 得到数据生成器 generator = load_data_generator(cfg) # In[5]: # 循环2个批次数据
# coding: utf-8 # In[1]: from detecting.config import cfg from detecting.build.fasterrcnn import FasterRCNNModel from detecting.datasets.datasets import load_data_generator from detecting.utils.compute_map import eval_show # In[ ]: # 与配置文件中的配置合并 cfg.merge_from_file('eval.yml') # 载入模型 model = FasterRCNNModel(cfg) # 数据生成器 generator = load_data_generator(cfg) # 评估结果 eval_show(model, generator)
# coding: utf-8 # In[ ]: from detecting.build.fasterrcnn import FasterRCNNModel from detecting.datasets.datasets import load_tf_dataset from detecting.config import cfg # In[ ]: # 与配置文件中的配置合并 cfg.merge_from_file('train.yml') # 载入数据集tf_dataset tf_dataset = load_tf_dataset(cfg) # 载入模型 model = FasterRCNNModel(cfg) # 训练模型 model.fit(tf_dataset)