Comments (1)
this may help
import os
import re
import matplotlib.pyplot as plt
import mplcursors
def extract_float_numbers(line):
"""
Extracts a floating-point number from the line containing the first floating-point number after "AP: ".
"""
match = re.search(r'AP: (\d+\.\d+)', line)
if match:
return float(match.group(1))
else:
return None
def read_log_file(file_path):
"""
Read log files and extract floating-point numbers.
"""
float_numbers = []
with open(file_path, 'r') as file:
for line in file:
if "Epoch(val)" in line:
number = extract_float_numbers(line)
if number is not None:
float_numbers.append(number)
return float_numbers
def plot_line_chart(float_numbers):
"""
Draw a line chart.
"""
_, ax = plt.subplots()
ax.plot(range(len(float_numbers)), float_numbers)
ax.set(xlabel='Index', ylabel='Value', title='Line Chart')
ax.set_xlim(0, 25)
ax.set_ylim(0.4, 0.75)
# Labeled data point
for i, value in enumerate(float_numbers):
ax.annotate(f'{value:.2f}', (i, value), textcoords="offset points", xytext=(0,10), ha='center', fontsize=2)
# Add interactive tags
colorss = ['g', 'r', 'c', 'm', 'y', 'k', 'b']
offs = -20
def main():
# Obtain the.log file in the current directory
log_files = [f for f in os.listdir() if f.endswith('.log')]
_, ax = plt.subplots()
ax.set(xlabel='epoch/10', ylabel='AP', title='Line Chart')
ax.set_xlim(0, 25)
ax.set_ylim(0.5, 0.75)
for j, pa in enumerate(log_files):
log_file_path = pa
float_numbers = read_log_file(log_file_path)
ax.plot(range(len(float_numbers)), float_numbers, color=colorss[j % len(colorss)])
for i, value in enumerate(float_numbers):
ax.annotate(f'{value:.3f}', (i, value), textcoords="offset points", xytext=(0, offs + 40 * j), ha='center')
mplcursors.cursor(hover=True)
plt.show()
if __name__ == "__main__":
main()
from lite-hrnet.
Related Issues (20)
- Our new study on lightweight high resolution networks: Dite-HRNet HOT 1
- I got an issue about KeyError 'center',there is no keyword 'center' in result HOT 1
- Not able to download the test jsons?
- pretrained model problem
- lower mAP HOT 1
- Training custom model HOT 1
- Welcome update to OpenMMLab 2.0
- Why i got lower mIoU than HRNet-W16?
- cannot import name 'Config' from 'mmcv' HOT 3
- What is the model structure of small HRNet?
- ModuleNotFoundError: No module named 'mmcv.transforms' HOT 4
- ImportError: cannot import name 'BACKBONES' from 'mmdet.models'
- question about Figure 3 in the paper
- LiteHRNet的实时性为什么比MobileNetV3-Large差很多啊?
- ModuleNotFoundError: No module named 'mmcv'
- The inference scheme I implemented is only 2 FPS
- KeyError: "TopDown: 'LiteHRNet is not in the models registry'"
- KeyError: "TopDown: 'LiteHRNet is not in the models registry'"
- ModuleNotFoundError
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lite-hrnet.