1.aspå¾ç管çç³»ç»
2.controlnet源码解读
aspå¾ç管çç³»ç»
'åè½ï¼æç §æå®å¾ççæ缩ç¥å¾
'注æï¼ä»¥ä¸æå°çâè·¯å¾âé½æ¯å¼ç¸å¯¹äºè°ç¨æ¬å½æ°çæ件çç¸å¯¹è·¯å¾
'åæ°ï¼
' s_OriginalPath: åå¾çè·¯å¾ ä¾:images/image1.gif
' s_BuildBasePath: çæå¾ççåºè·¯å¾,图片ä¸è®ºæ¯å¦ä»¥â/âç»å°¾åå¯ ä¾:imagesæimages/
' n_MaxWidth: çæå¾çæ大宽度
' å¦æå¨åå°æ¾ç¤ºç缩ç¥å¾æ¯ *,è¿é n_MaxWidth=,n_MaxHeight=.
' n_MaxHeight: çæå¾çæ大é«åº¦
'è¿åå¼ï¼
' è¿åçæåç缩ç¥å¾çè·¯å¾
'é误å¤çï¼
' å¦æå½æ°æ§è¡è¿ç¨ä¸åºç°é误,å°è¿åé误代ç ,é误代ç 以 âErrorâå¼å¤´
' Error_:å建AspJpegç»ä»¶å¤±è´¥,没ææ£ç¡®å®è£ 注å该ç»ä»¶
' Error_:åå¾çä¸åå¨,æ£æ¥s_OriginalPathåæ°ä¼ å ¥å¼
' Error_:缩ç¥å¾åç失败.å¯è½åå :缩ç¥å¾ä¿ååºå°åä¸åå¨,æ£æ¥s_OriginalPathåæ°ä¼ å ¥å¼;对ç®å½æ²¡æåæé;ç£ç空é´ä¸è¶³
' Error_Other:æªç¥é误
'è°ç¨ä¾å:
' Dim sSmallPath '缩ç¥å¾è·¯å¾
' sSmallPath = BuildSmallPic("images/image1.gif", "images", , )
'================================================================
Function BuildSmallPic(s_OriginalPath, fileex,s_BuildBasePath, n_MaxWidth, n_MaxHeight)
Err.Clear
On Error Resume Next
'æ£æ¥ç»ä»¶æ¯å¦å·²ç»æ³¨å
Dim AspJpeg
Set AspJpeg = Server.Createobject("Persits.Jpeg")
If Err.Number <> 0 Then
Err.Clear
BuildSmallPic = "Error_"
Exit Function
End If 'æ£æ¥åå¾çæ¯å¦åå¨
Dim s_MapOriginalPath
s_MapOriginalPath = Server.MapPath(s_OriginalPath)
AspJpeg.Open s_MapOriginalPath 'æå¼åå¾ç
If Err.Number <> 0 Then
Err.Clear
BuildSmallPic = "Error_"
Exit Function
End If 'ææ¯ä¾åå¾ç¼©ç¥å¾å®½åº¦åé«åº¦
Dim n_OriginalWidth, n_OriginalHeight 'åå¾ç宽度ãé«åº¦
Dim n_BuildWidth, n_BuildHeight '缩ç¥å¾å®½åº¦ãé«åº¦
Dim div1, div2
Dim n1, n2
n_OriginalWidth = AspJpeg.Width
n_OriginalHeight = AspJpeg.Height
div1 = n_OriginalWidth / n_OriginalHeight
div2 = n_OriginalHeight / n_OriginalWidth
n1 = 0
n2 = 0
If n_OriginalWidth > n_MaxWidth Then
n1 = n_OriginalWidth / n_MaxWidth
Else
n_BuildWidth = n_OriginalWidth
End If
If n_OriginalHeight > n_MaxHeight Then
n2 = n_OriginalHeight / n_MaxHeight
Else
n_BuildHeight = n_OriginalHeight
End If
If n1 <> 0 Or n2 <> 0 Then
If n1 > n2 Then
n_BuildWidth = n_MaxWidth
n_BuildHeight = n_MaxWidth * div2
Else
n_BuildWidth = n_MaxHeight * div1
n_BuildHeight = n_MaxHeight
End If
End If 'æå®å®½åº¦åé«åº¦çæ
AspJpeg.Width = n_BuildWidth
AspJpeg.Height = n_BuildHeight
'--å°ç¼©ç¥å¾åçå¼å§--
Dim pos, s_OriginalFileName, s_OriginalFileExt 'ä½ç½®ãåæ件åãåæ件æ©å±å
pos = InStrRev(s_OriginalPath, "/") + 1
s_OriginalFileName = Mid(s_OriginalPath, pos)
pos = InStrRev(s_OriginalFileName, ".")
s_OriginalFileExt = Mid(s_OriginalFileName, pos) Dim s_MapBuildBasePath, s_MapBuildPath, s_BuildFileName '缩ç¥å¾ç»å¯¹è·¯å¾ã缩ç¥å¾æ件å
Dim s_EndFlag 'å°å¾çæ件åç»å°¾æ è¯ ä¾: å¦æ大å¾çæ件åæ¯âimage1.gifâ,ç»å°¾æ è¯æ¯â_smallâ,é£ä¹å°å¾çæ件åå°±æ¯âimage1_small.gifâ
If Right(s_BuildBasePath, 1) <> "/" Then s_BuildBasePath = s_BuildBasePath & "/"
s_MapBuildBasePath = Server.MapPath(s_BuildBasePath)
s_EndFlag = fileex 'å¯ä»¥èªå®ä¹,åªè¦è½åºå«å¤§å°å¾çå³å¯
s_BuildFileName = Replace(s_OriginalFileName, s_OriginalFileExt, "") & s_EndFlag & s_OriginalFileExt
s_MapBuildPath = s_MapBuildBasePath & "\" & s_BuildFileName
AspJpeg.Save s_MapBuildPath 'ä¿å
If Err.Number <> 0 Then
Err.Clear
BuildSmallPic = "Error_"
Exit Function
End If
'--å°ç¼©ç¥å¾åçç»æ-- '注éå®ä¾
Set AspJpeg = Nothing
If Err.Number <> 0 Then
BuildSmallPic = "Error_Other"
Err.Clear
End If
BuildSmallPic = s_BuildBasePath & s_BuildFileName
End Function
controlnet源码解读
ControlNet是一种用于控制生成的网络结构,其源码主要包含以下几个部分:1.模型定义:通过继承自torch.nn.Module的系统retrofit 源码 简书ControlNet类来实现模型的定义。2.数据加载:ControlNet的源码同乡社区源码数据加载在data.py文件中。3.训练过程:ControlNet的图片svg读取源码训练过程在train.py文件中。4.测试过程:ControlNet的系统cas java源码测试过程在test.py文件中。源码屠龙单机 源码源码屠龙单机 源码